]> git.sur5r.net Git - cc65/commitdiff
added support for undocumented NOPs
authormrdudz <mrdudz@users.noreply.github.com>
Wed, 19 Nov 2014 22:20:46 +0000 (23:20 +0100)
committermrdudz <mrdudz@users.noreply.github.com>
Wed, 19 Nov 2014 22:20:46 +0000 (23:20 +0100)
src/ca65/instr.c
testcode/assembler/.gitignore
testcode/assembler/all.s
testcode/assembler/illegal.s
testcode/assembler/legal.s

index 6e31896ea2943bf0bfbd30d20be7ea9730f70117..945d5ee797eebbc362e3dae75d20869b21a264ee 100644 (file)
@@ -262,7 +262,7 @@ static const struct {
         { "LDX",  0x080030C, 0xa2, 1, PutAll },
         { "LDY",  0x080006C, 0xa0, 1, PutAll },
         { "LSR",  0x000006F, 0x42, 1, PutAll },
-        { "NOP",  0x0000001, 0xea, 0, PutAll },
+        { "NOP",  0x080006D, 0x00, 10, PutAll },        /* X */
         { "ORA",  0x080A26C, 0x00, 0, PutAll },
         { "PHA",  0x0000001, 0x48, 0, PutAll },
         { "PHP",  0x0000001, 0x08, 0, PutAll },
@@ -790,7 +790,7 @@ const InsTable* InsTab = (const InsTable*) &InsTab6502;
 /* Table to build the effective 65xx opcode from a base opcode and an
 ** addressing mode. (The value in the table is ORed with the base opcode)
 */
-static unsigned char EATab[10][AM65I_COUNT] = {
+static unsigned char EATab[11][AM65I_COUNT] = {
     {   /* Table 0 */
         0x00, 0x00, 0x05, 0x0D, 0x0F, 0x15, 0x1D, 0x1F,
         0x00, 0x19, 0x12, 0x00, 0x07, 0x11, 0x17, 0x01,
@@ -851,6 +851,12 @@ static unsigned char EATab[10][AM65I_COUNT] = {
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00
     },
+    {   /* Table 10 (NOPs) */
+        0xea, 0x00, 0x04, 0x0c, 0x00, 0x14, 0x1c, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+        0x00, 0x00, 0x00
+    },
 };
 
 /* Table to build the effective SWEET16 opcode from a base opcode and an
index 160ca9ba4268f912f7d115ec5c6d1c0243a11cfa..3694d870237fb749a613c0bc803b1830add4f30b 100644 (file)
@@ -1,2 +1,4 @@
 chkillegal.bin
 chklegal.bin
+legal.o
+illegal.o
index 5471a2bb197cb4e96ea33ef4f4b9d90128593ff4..286f52670daecdc39e62ec19af3835191beabd84 100644 (file)
@@ -1,3 +1,5 @@
+        .setcpu         "6502X"
+
             brk                 ; 00
             ora ($12,x)         ; 01 12
             jam                 ; 02
index 51d40afa7d3b3661ec4e4fe5bc0e2440d8e8bd86..1a1841fb3abc6daab3b810aad3a340325349b130 100644 (file)
@@ -63,7 +63,6 @@
         lax ($12),y         ; b3 12
         lax $12,y           ; b7 12
 
-
         anc #$12            ; 0b 12
         ;anc #$12           ; 2b 12
 
 
         axs #$12            ; cb 12
 
-;        nop $12             ; 04 12
-;        nop $1234           ; 0c 34 12
-;        nop $1234,x         ; 1c 34 12
-;        nop $1234,x         ; 3c 34 12
-;        nop $1234,x         ; 5c 34 12
-;        nop $1234,x         ; 7c 34 12
-;        nop $1234,x         ; dc 34 12
-;        nop $1234,x         ; fc 34 12
-;        nop $12             ; 44 12
-;        nop $12             ; 64 12
-;        nop #$12            ; 80 12
-;        nop #$12            ; 82 12
-;        nop #$12            ; 89 12
-;        nop #$12            ; c2 12
-;        nop #$12            ; e2 12
-;        nop $12,x           ; 14 12
-;        nop $12,x           ; 34 12
-;        nop $12,x           ; 54 12
-;        nop $12,x           ; 74 12
-;        nop $12,x           ; d4 12
-;        nop $12,x           ; f4 12
-;        nop                 ; 1a
-;        nop                 ; 3a
-;        nop                 ; 5a
-;        nop                 ; 7a
-;        nop                 ; da
-
-;        jam                 ; 02
+        nop $1234           ; 0c 34 12
+        nop $1234,x         ; 1c 34 12
+        nop $12             ; 04 12
+        nop $12,x           ; 14 12
+        nop #$12            ; 80 12
+        ;nop $1234,x        ; 3c 34 12
+        ;nop $1234,x        ; 5c 34 12
+        ;nop $1234,x        ; 7c 34 12
+        ;nop $1234,x        ; dc 34 12
+        ;nop $1234,x        ; fc 34 12
+        ;nop $12            ; 44 12
+        ;nop $12            ; 64 12
+        ;nop #$12           ; 82 12
+        ;nop #$12           ; 89 12
+        ;nop #$12           ; c2 12
+        ;nop #$12           ; e2 12
+        ;nop $12,x          ; 34 12
+        ;nop $12,x          ; 54 12
+        ;nop $12,x          ; 74 12
+        ;nop $12,x          ; d4 12
+        ;nop $12,x          ; f4 12
+        ;nop                ; 1a
+        ;nop                ; 3a
+        ;nop                ; 5a
+        ;nop                ; 7a
+        ;nop                ; da
+
+        jam                 ; 02
         ;jam                ; 12
         ;jam                ; 22
         ;jam                ; 32
 
         ;sbc #$12           ; eb 12
 
-; and the so-called "unstable" ones:
+; the so-called "unstable" ones:
 
         sha ($12),y         ; 93 12
         sha $1234,y         ; 9f 34 12
         shs $1234,y         ; 9b 34 12
         las $1234,y         ; bb 34 12
 
-; the two "highly unstable" ones:
+; the two so-called "highly unstable" ones:
 
 ;        lax #$12            ; ab 12
 
index 379d6cd3ac2e2e45ca4170047c0cef246b5c3574..10377b4b8dacdf46fd1788305d195ebd0f152fcb 100644 (file)
@@ -1,3 +1,6 @@
+
+        .setcpu         "6502"
+
             adc $1234           ; 6d 34 12
             adc $1234,x         ; 7d 34 12
             adc $1234,y         ; 79 34 12