OSDN Git Service

- dec zp,x/abs,x
authorastoria-d <astoria-d@mail.goo.ne.jp>
Sun, 11 Aug 2013 08:46:32 +0000 (17:46 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Sun, 11 Aug 2013 08:46:32 +0000 (17:46 +0900)
- inc zp,x/abs,x supported.

simulation/cpu/decoder.vhd
tools/test-image/sample1.asm

index e5ba309..1744fc7 100644 (file)
@@ -1881,6 +1881,10 @@ end  procedure;
                 elsif instruction  = conv_std_logic_vector(16#d6#, dsize) then
                     --zp, x
                     d_print("dec");
+                    a4_zp_x;
+                    if exec_cycle = T5 then
+                        set_nz_from_bus;
+                    end if;
 
                 elsif instruction  = conv_std_logic_vector(16#ce#, dsize) then
                     --abs
@@ -1893,6 +1897,10 @@ end  procedure;
                 elsif instruction  = conv_std_logic_vector(16#de#, dsize) then
                     --abs, x
                     d_print("dec");
+                    a4_abs_x;
+                    if exec_cycle = T6 then
+                        set_nz_from_bus;
+                    end if;
 
                 elsif instruction  = conv_std_logic_vector(16#e6#, dsize) then
                     --zp
@@ -1905,6 +1913,10 @@ end  procedure;
                 elsif instruction  = conv_std_logic_vector(16#f6#, dsize) then
                     --zp, x
                     d_print("inc");
+                    a4_zp_x;
+                    if exec_cycle = T5 then
+                        set_nz_from_bus;
+                    end if;
 
                 elsif instruction  = conv_std_logic_vector(16#ee#, dsize) then
                     --abs
@@ -1917,6 +1929,10 @@ end  procedure;
                 elsif instruction  = conv_std_logic_vector(16#fe#, dsize) then
                     --abs, x
                     d_print("inc");
+                    a4_abs_x;
+                    if exec_cycle = T6 then
+                        set_nz_from_bus;
+                    end if;
 
                 elsif instruction  = conv_std_logic_vector(16#46#, dsize) then
                     --zp
index 5036571..4e001cb 100644 (file)
@@ -551,6 +551,31 @@ boundary_3_4:
     ldx #$55\r
     ldx $d0, y\r
 \r
+    ;;dec zp, x/abs, x\r
+    ;;inc zp, x/abs, x\r
+    lda #$00\r
+    ldx #$e4\r
+    sta $88\r
+    ldy #$00\r
+    dec $a4, x\r
+\r
+    ldx #$64\r
+    stx $0722\r
+    dec $06be, x\r
+\r
+    lda #$fe\r
+    ldx #$e4\r
+    sta $88\r
+    inc $a4, x\r
+    inc $a4, x\r
+    inc $a4, x\r
+\r
+    ldx #$64\r
+    stx $0722\r
+    inc $06be, x\r
+\r
+\r
+    ;;done...\r
     ;;infinite loop.\r
 mainloop:\r
        jmp     mainloop\r