From 2dfdf4dec70b418b4fa3e63ed99d7be9cc59895f Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 19 Nov 2014 22:34:33 +0100 Subject: [PATCH] added support for ane, sha, shs, shy, shx --- src/ca65/instr.c | 7 +++++- testcode/assembler/illegal.s | 45 +++++++++++++++++------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/ca65/instr.c b/src/ca65/instr.c index 9270f5601..6e31896ea 100644 --- a/src/ca65/instr.c +++ b/src/ca65/instr.c @@ -215,7 +215,7 @@ static const struct { /* Instruction table for the 6502 with illegal instructions */ static const struct { unsigned Count; - InsDesc Ins[70]; + InsDesc Ins[75]; } InsTab6502X = { sizeof (InsTab6502X.Ins) / sizeof (InsTab6502X.Ins[0]), { @@ -223,6 +223,7 @@ static const struct { { "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */ { "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X */ { "AND", 0x080A26C, 0x20, 0, PutAll }, + { "ANE", 0x0800000, 0x8B, 0, PutAll }, /* X */ { "ARR", 0x0800000, 0x6B, 0, PutAll }, /* X */ { "ASL", 0x000006e, 0x02, 1, PutAll }, { "AXS", 0x0800000, 0xCB, 0, PutAll }, /* X */ @@ -278,6 +279,10 @@ static const struct { { "SEC", 0x0000001, 0x38, 0, PutAll }, { "SED", 0x0000001, 0xf8, 0, PutAll }, { "SEI", 0x0000001, 0x78, 0, PutAll }, + { "SHA", 0x0002200, 0x93, 1, PutAll }, /* X */ + { "SHS", 0x0000200, 0x9b, 0, PutAll }, /* X */ + { "SHX", 0x0000200, 0x9e, 1, PutAll }, /* X */ + { "SHY", 0x0000040, 0x9c, 1, PutAll }, /* X */ { "SLO", 0x000A26C, 0x03, 0, PutAll }, /* X */ { "SRE", 0x000A26C, 0x43, 0, PutAll }, /* X */ { "STA", 0x000A26C, 0x80, 0, PutAll }, diff --git a/testcode/assembler/illegal.s b/testcode/assembler/illegal.s index 5145e31e5..51d40afa7 100644 --- a/testcode/assembler/illegal.s +++ b/testcode/assembler/illegal.s @@ -1,7 +1,7 @@ .setcpu "6502X" -; first all totally staple undocs: +; first all totally stable undocs: slo $12 ; 07 12 slo $1234 ; 0f 34 12 @@ -65,7 +65,7 @@ anc #$12 ; 0b 12 - ;anc #$12 ; 2b 12 + ;anc #$12 ; 2b 12 arr #$12 ; 6b 12 @@ -101,36 +101,33 @@ ; nop ; da ; jam ; 02 -; jam ; 12 -; jam ; 22 -; jam ; 32 -; jam ; 42 -; jam ; 52 -; jam ; 62 -; jam ; 72 -; jam ; 92 -; jam ; b2 -; jam ; d2 -; jam ; f2 + ;jam ; 12 + ;jam ; 22 + ;jam ; 32 + ;jam ; 42 + ;jam ; 52 + ;jam ; 62 + ;jam ; 72 + ;jam ; 92 + ;jam ; b2 + ;jam ; d2 + ;jam ; f2 ;sbc #$12 ; eb 12 -; and the so called "unstable" ones: +; and the so-called "unstable" ones: - las $1234,y ; bb 34 12 - -; sha $1234,y ; 9f 34 12 -; sha ($12),y ; 93 12 - -; shs $1234,y ; 9b 34 12 + sha ($12),y ; 93 12 + sha $1234,y ; 9f 34 12 -; shx $1234,y ; 9e 34 12 + shx $1234,y ; 9e 34 12 + shy $1234,x ; 9c 34 12 -; shy $1234,x ; 9c 34 12 + shs $1234,y ; 9b 34 12 + las $1234,y ; bb 34 12 ; the two "highly unstable" ones: ; lax #$12 ; ab 12 -; ane #$12 ; 8b 12 - + ane #$12 ; 8b 12 -- 2.39.5