summaryrefslogtreecommitdiff
path: root/asmmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'asmmon.c')
-rw-r--r--asmmon.c132
1 files changed, 67 insertions, 65 deletions
diff --git a/asmmon.c b/asmmon.c
index 422d8ce..da52920 100644
--- a/asmmon.c
+++ b/asmmon.c
@@ -4,7 +4,7 @@
#define debug 1
-#define OPNUM 89
+#define OPNUM 91
#define SETOP(num, _mne, _IMM, _ZM, _ZMX, _ZMY, _ABS, _IMPL) \
{opcodes[num].mnemonic[3] = '\0'; strncpy(opcodes[num].mnemonic, _mne, 3); \
opcodes[num].imm = _IMM; \
@@ -151,70 +151,72 @@ int asmmon(const char *fn) {
SETOP(22, "ANX", 0x24, 0x84, 0x00, 0x00, 0x54, 0x00);
SETOP(23, "AAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x25);
SETOP(24, "STT", 0x28, 0x00, 0x00, 0x00, 0x00, 0x00);
- SETOP(25, "TSX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x2E);
- SETOP(26, "BPO", 0x00, 0x00, 0x00, 0x00, 0x30, 0x00);
- SETOP(27, "ORA", 0x31, 0x3B, 0x00, 0x00, 0x39, 0x00);
- SETOP(28, "ORY", 0x32, 0x00, 0x00, 0x00, 0x62, 0x00);
- SETOP(29, "OAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0x33);
- SETOP(23, "ORX", 0x34, 0x94, 0x00, 0x00, 0x64, 0x00);
- SETOP(31, "OAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x35);
- SETOP(32, "SEI", 0x00, 0x00, 0x00, 0x00, 0x00, 0x38);
- SETOP(33, "TXS", 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00);
- SETOP(34, "BNG", 0x00, 0x00, 0x00, 0x00, 0x40, 0x00);
- SETOP(35, "XOR", 0x41, 0x4B, 0x00, 0x00, 0x49, 0x00);
- SETOP(36, "XRY", 0x42, 0xA2, 0x00, 0x00, 0x72, 0x00);
- SETOP(37, "XAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0x43);
- SETOP(38, "XRX", 0x44, 0xA4, 0x00, 0x00, 0x74, 0x00);
- SETOP(39, "XAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x45);
- SETOP(40, "CLI", 0x00, 0x00, 0x00, 0x00, 0x00, 0x48);
- SETOP(41, "BCS", 0x00, 0x00, 0x00, 0x00, 0x50, 0x00);
- SETOP(42, "LSL", 0x51, 0x55, 0x00, 0x00, 0x53, 0x00);
- SETOP(43, "SEC", 0x00, 0x00, 0x00, 0x00, 0x00, 0x58);
- SETOP(44, "STA", 0x00, 0x7B, 0x8B, 0x9B, 0x5B, 0x00);
- SETOP(45, "STY", 0x00, 0x7D, 0x8D, 0x00, 0x5D, 0x00);
- SETOP(46, "STX", 0x00, 0x7E, 0x00, 0x9E, 0x5E, 0x00);
- SETOP(47, "BCC", 0x00, 0x00, 0x00, 0x00, 0x60, 0x00);
- SETOP(48, "LSR", 0x61, 0x65, 0x00, 0x00, 0x63, 0x00);
- SETOP(49, "CLC", 0x00, 0x00, 0x00, 0x00, 0x00, 0x68);
- SETOP(50, "LDA", 0x69, 0x79, 0x89, 0x99, 0x59, 0x00);
- SETOP(51, "LDY", 0x6A, 0x7A, 0x8A, 0x00, 0x5A, 0x00);
- SETOP(52, "LDX", 0x6C, 0x7C, 0x00, 0x9C, 0x5C, 0x00);
- SETOP(53, "BEQ", 0x00, 0x00, 0x00, 0x00, 0x70, 0x00);
- SETOP(54, "ROL", 0x71, 0x75, 0x00, 0x00, 0x73, 0x00);
- SETOP(55, "SSP", 0x00, 0x00, 0x00, 0x00, 0x00, 0x78);
- SETOP(56, "BNE", 0x00, 0x00, 0x00, 0x00, 0x80, 0x00);
- SETOP(57, "ROR", 0x81, 0x85, 0x00, 0x00, 0x83, 0x00);
- SETOP(58, "CSP", 0x00, 0x00, 0x00, 0x00, 0x00, 0x88);
- SETOP(59, "BVS", 0x00, 0x00, 0x00, 0x00, 0x90, 0x00);
- SETOP(60, "MUL", 0x91, 0x95, 0x00, 0x00, 0x93, 0x00);
- SETOP(61, "SEV", 0x00, 0x00, 0x00, 0x00, 0x00, 0x98);
- SETOP(62, "BVC", 0x00, 0x00, 0x00, 0x00, 0xA0, 0x00);
- SETOP(63, "DIV", 0xA1, 0xA5, 0x00, 0x00, 0xA3, 0x00);
- SETOP(64, "CLV", 0x00, 0x00, 0x00, 0x00, 0x00, 0xA8);
- SETOP(65, "ASR", 0xA9, 0xAD, 0x00, 0x00, 0xAB, 0x00);
- SETOP(66, "RTS", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0);
- SETOP(67, "CMP", 0xB1, 0xF5, 0x00, 0x00, 0xE5, 0x00);
- SETOP(68, "CPY", 0xB2, 0xF2, 0x00, 0x00, 0xE2, 0x00);
- SETOP(69, "CAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3);
- SETOP(70, "CPX", 0xB4, 0xF4, 0x00, 0x00, 0xE4, 0x00);
- SETOP(71, "CAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5);
- SETOP(72, "ENT", 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00);
- SETOP(73, "RTI", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0);
- SETOP(74, "INC", 0x00, 0xE3, 0x00, 0x00, 0xE1, 0xC1);
- SETOP(75, "INY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2);
- SETOP(76, "IAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3);
- SETOP(77, "INX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4);
- SETOP(78, "IAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5);
- SETOP(79, "DEC", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1);
- SETOP(80, "DEY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD2);
- SETOP(81, "DAY", 0x00, 0xF3, 0x00, 0x00, 0xF1, 0xD3);
- SETOP(82, "DEX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD4);
- SETOP(83, "DAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5);
- SETOP(84, "WAI", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8);
- SETOP(85, "JSL", 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00);
- SETOP(86, "NOP", 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8);
- SETOP(87, "RTL", 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0);
- SETOP(88, "BRK", 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8);
+ SETOP(25, "TAB", 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C);
+ SETOP(26, "TSX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x2E);
+ SETOP(27, "BPO", 0x00, 0x00, 0x00, 0x00, 0x30, 0x00);
+ SETOP(28, "ORA", 0x31, 0x3B, 0x00, 0x00, 0x39, 0x00);
+ SETOP(29, "ORY", 0x32, 0x00, 0x00, 0x00, 0x62, 0x00);
+ SETOP(23, "OAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0x33);
+ SETOP(31, "ORX", 0x34, 0x94, 0x00, 0x00, 0x64, 0x00);
+ SETOP(32, "OAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x35);
+ SETOP(33, "SEI", 0x00, 0x00, 0x00, 0x00, 0x00, 0x38);
+ SETOP(34, "TBA", 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C);
+ SETOP(35, "TXS", 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00);
+ SETOP(36, "BNG", 0x00, 0x00, 0x00, 0x00, 0x40, 0x00);
+ SETOP(37, "XOR", 0x41, 0x4B, 0x00, 0x00, 0x49, 0x00);
+ SETOP(38, "XRY", 0x42, 0xA2, 0x00, 0x00, 0x72, 0x00);
+ SETOP(39, "XAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0x43);
+ SETOP(40, "XRX", 0x44, 0xA4, 0x00, 0x00, 0x74, 0x00);
+ SETOP(41, "XAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0x45);
+ SETOP(42, "CLI", 0x00, 0x00, 0x00, 0x00, 0x00, 0x48);
+ SETOP(43, "BCS", 0x00, 0x00, 0x00, 0x00, 0x50, 0x00);
+ SETOP(44, "LSL", 0x51, 0x55, 0x00, 0x00, 0x53, 0x00);
+ SETOP(45, "SEC", 0x00, 0x00, 0x00, 0x00, 0x00, 0x58);
+ SETOP(46, "STA", 0x00, 0x7B, 0x8B, 0x9B, 0x5B, 0x00);
+ SETOP(47, "STY", 0x00, 0x7D, 0x8D, 0x00, 0x5D, 0x00);
+ SETOP(48, "STX", 0x00, 0x7E, 0x00, 0x9E, 0x5E, 0x00);
+ SETOP(49, "BCC", 0x00, 0x00, 0x00, 0x00, 0x60, 0x00);
+ SETOP(50, "LSR", 0x61, 0x65, 0x00, 0x00, 0x63, 0x00);
+ SETOP(51, "CLC", 0x00, 0x00, 0x00, 0x00, 0x00, 0x68);
+ SETOP(52, "LDA", 0x69, 0x79, 0x89, 0x99, 0x59, 0x00);
+ SETOP(53, "LDY", 0x6A, 0x7A, 0x8A, 0x00, 0x5A, 0x00);
+ SETOP(54, "LDX", 0x6C, 0x7C, 0x00, 0x9C, 0x5C, 0x00);
+ SETOP(55, "BEQ", 0x00, 0x00, 0x00, 0x00, 0x70, 0x00);
+ SETOP(56, "ROL", 0x71, 0x75, 0x00, 0x00, 0x73, 0x00);
+ SETOP(57, "SSP", 0x00, 0x00, 0x00, 0x00, 0x00, 0x78);
+ SETOP(58, "BNE", 0x00, 0x00, 0x00, 0x00, 0x80, 0x00);
+ SETOP(59, "ROR", 0x81, 0x85, 0x00, 0x00, 0x83, 0x00);
+ SETOP(60, "CSP", 0x00, 0x00, 0x00, 0x00, 0x00, 0x88);
+ SETOP(61, "BVS", 0x00, 0x00, 0x00, 0x00, 0x90, 0x00);
+ SETOP(62, "MUL", 0x91, 0x95, 0x00, 0x00, 0x93, 0x00);
+ SETOP(63, "SEV", 0x00, 0x00, 0x00, 0x00, 0x00, 0x98);
+ SETOP(64, "BVC", 0x00, 0x00, 0x00, 0x00, 0xA0, 0x00);
+ SETOP(65, "DIV", 0xA1, 0xA5, 0x00, 0x00, 0xA3, 0x00);
+ SETOP(66, "CLV", 0x00, 0x00, 0x00, 0x00, 0x00, 0xA8);
+ SETOP(67, "ASR", 0xA9, 0xAD, 0x00, 0x00, 0xAB, 0x00);
+ SETOP(68, "RTS", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0);
+ SETOP(69, "CMP", 0xB1, 0xF5, 0x00, 0x00, 0xE5, 0x00);
+ SETOP(70, "CPY", 0xB2, 0xF2, 0x00, 0x00, 0xE2, 0x00);
+ SETOP(71, "CAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3);
+ SETOP(72, "CPX", 0xB4, 0xF4, 0x00, 0x00, 0xE4, 0x00);
+ SETOP(73, "CAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5);
+ SETOP(74, "ENT", 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00);
+ SETOP(75, "RTI", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0);
+ SETOP(76, "INC", 0x00, 0xE3, 0x00, 0x00, 0xE1, 0xC1);
+ SETOP(77, "INY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2);
+ SETOP(78, "IAY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3);
+ SETOP(79, "INX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4);
+ SETOP(80, "IAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5);
+ SETOP(81, "DEC", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1);
+ SETOP(82, "DEY", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD2);
+ SETOP(83, "DAY", 0x00, 0xF3, 0x00, 0x00, 0xF1, 0xD3);
+ SETOP(84, "DEX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD4);
+ SETOP(85, "DAX", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5);
+ SETOP(86, "WAI", 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8);
+ SETOP(87, "JSL", 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00);
+ SETOP(88, "NOP", 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8);
+ SETOP(89, "RTL", 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0);
+ SETOP(90, "BRK", 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8);
FILE *fp;
if (strcasecmp(fn, "stdin") != 0) {
fp = fopen(fn, "r");