From edacd98cb14e5a98e559f057f85a6da0bd78efd8 Mon Sep 17 00:00:00 2001 From: astoria-d Date: Sat, 10 Aug 2013 18:34:13 +0900 Subject: [PATCH] - ldx zp,y - ldy abs,x supported. --- simulation/cpu/decoder.vhd | 11 ++++++++++- tools/test-image/sample1.asm | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/simulation/cpu/decoder.vhd b/simulation/cpu/decoder.vhd index abeee3e..e5ba309 100644 --- a/simulation/cpu/decoder.vhd +++ b/simulation/cpu/decoder.vhd @@ -1602,6 +1602,11 @@ end procedure; elsif instruction = conv_std_logic_vector(16#b6#, dsize) then --zp, y d_print("ldx"); + a2_zp_xy(false); + if exec_cycle = T3 then + front_we(x_cmd, '0'); + set_nz_from_bus; + end if; elsif instruction = conv_std_logic_vector(16#ae#, dsize) then --abs @@ -1658,7 +1663,11 @@ end procedure; elsif instruction = conv_std_logic_vector(16#bc#, dsize) then --abs, x d_print("ldy"); - --todo.... + a2_abs_xy(true); + if exec_cycle = T3 or exec_cycle = T4 then + set_nz_from_bus; + front_we(y_cmd, '0'); + end if; elsif instruction = conv_std_logic_vector(16#09#, dsize) then --imm diff --git a/tools/test-image/sample1.asm b/tools/test-image/sample1.asm index a47261f..5036571 100644 --- a/tools/test-image/sample1.asm +++ b/tools/test-image/sample1.asm @@ -534,6 +534,22 @@ boundary_3_4: ;01>1 = 00 w/ carry. lsr $0734 + ;;ldy abs, x + ;;ldx zp, y + ldx #$fa + stx $0820 + ;;page cross + ldy $0726, x + + ldx #$10 + stx $0820 + ;no page cross + ldy $0810, x + + ldy #$10 + sty $e0 + ldx #$55 + ldx $d0, y ;;infinite loop. mainloop: -- 2.11.0