1
0
mirror of https://github.com/brouhaha/dis6502.git synced 2024-06-02 10:41:30 +00:00

Old updates, unfortunately don't remember the details.

This commit is contained in:
Eric Smith 2016-06-21 00:00:00 -06:00
parent 59e200b84b
commit 6543495dda
6 changed files with 311 additions and 329 deletions

18
dis.h
View File

@ -1,8 +1,8 @@
/* /*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
* *
* $Id$ * $Id: dis.h 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2003 Eric Smith <eric@brouhaha.com> * Copyright 2000-2016 Eric Smith <spacewar@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -37,6 +37,10 @@ extern int bopt;
enum boot_mode { UNKNOWN, RAW_BINARY, ATARI_LOAD, C64_LOAD, ATARI_BOOT }; enum boot_mode { UNKNOWN, RAW_BINARY, ATARI_LOAD, C64_LOAD, ATARI_BOOT };
extern int base_address, vector_address; extern int base_address, vector_address;
#define MAX_ENTRY 100
extern int entry_count;
extern int entry_address[MAX_ENTRY];
extern int asmout; extern int asmout;
extern unsigned char f[]; extern unsigned char f[];
extern unsigned char d[]; extern unsigned char d[];
@ -57,7 +61,7 @@ extern long offset[];
#define OFFSET 0x80 /* should be printed as an offset */ #define OFFSET 0x80 /* should be printed as an offset */
struct info { struct info {
char opn[4]; char *opn;
int nb; int nb;
int flag; int flag;
}; };
@ -68,12 +72,11 @@ extern struct info optbl[];
/* Where control goes */ /* Where control goes */
#define NORM 1
#define JUMP 2 #define JUMP 2
#define FORK 4 #define FORK 4
#define STOP 8 #define STOP 8
#define CTLMASK (NORM|JUMP|FORK|STOP) #define CTLMASK (JUMP|FORK|STOP)
/* Instruction format */ /* Instruction format */
@ -90,9 +93,9 @@ extern struct info optbl[];
#define IND 0x8000 #define IND 0x8000
#define ZPY 0x10000 #define ZPY 0x10000
#define ZPG 0x20000 #define ZPG 0x20000
#define ILL 0x40000 #define INZ 0x40000
#define ADRMASK (IMM|ABS|ACC|IMP|INX|INY|ZPX|ABX|ABY|REL|IND|ZPY|ZPG|ILL) #define ADRMASK (IMM|ABS|ACC|IMP|INX|INY|ZPX|ABX|ABY|REL|IND|ZPY|ZPG|INZ)
struct ref_chain { struct ref_chain {
struct ref_chain *next; struct ref_chain *next;
@ -115,7 +118,6 @@ char *get_name(addr_t loc);
#define TJTAB2 264 #define TJTAB2 264
#define EQS 265 #define EQS 265
#define OFS 266 #define OFS 266
#define TJTAB 267
extern FILE *yyin, *yyout; extern FILE *yyin, *yyout;
int lineno; int lineno;

View File

@ -16,8 +16,14 @@ int npredef = 0;
char *file; char *file;
char *progname = "dis"; char *progname = "dis";
int bopt = UNKNOWN; int bopt = UNKNOWN;
int base_address = 0; int base_address = 0;
int vector_address = 0x10000; int vector_address = 0x10000;
int entry_count = 0;
int entry_address[MAX_ENTRY];
int asmout = 0; int asmout = 0;
void usage (void) void usage (void)
@ -29,8 +35,9 @@ void usage (void)
" -c Commodore 64\n" " -c Commodore 64\n"
" options: -a assembly output\n" " options: -a assembly output\n"
" -p <file> predefs\n" " -p <file> predefs\n"
" -e <address> alternate entry point address\n"
" -v <address> alternate vector address\n" " -v <address> alternate vector address\n"
" -7 mask character data to 7-bit\n", " -7 mask character data to 7-bit",
progname); progname);
exit (1); exit (1);
} }
@ -67,6 +74,12 @@ void initopts (int argc, char *argv[])
bopt = RAW_BINARY; bopt = RAW_BINARY;
argc--; argc--;
break; break;
case 'e':
entry_address [entry_count++] = strtoul (*++argv, &p, 0);
if (*p)
crash ("address required");
argc--;
break;
case 'v': case 'v':
vector_address = strtoul (*++argv, &p, 0); vector_address = strtoul (*++argv, &p, 0);
if (*p) if (*p)

12
lex.l
View File

@ -1,8 +1,8 @@
/* /*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
* *
* $Id$ * $Id: lex.l 26 2004-01-17 23:28:23Z eric $
* Copyright 2001-2003, 2008 Eric Smith <eric@brouhaha.com> * Copyright 2001-2014 Eric Smith <eric@brouhaha.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -28,6 +28,7 @@
#include <string.h> #include <string.h>
#include "dis.h" #include "dis.h"
int lineno = 0; int lineno = 0;
char *strcpy();
%} %}
%option nounput %option nounput
@ -61,13 +62,6 @@ alphanum [0-9a-zA-Z_]
\.[Jj][Tt][Aa][Bb]2 { return TJTAB2; } \.[Jj][Tt][Aa][Bb]2 { return TJTAB2; }
\.[Jj][Tt][Aa][Bb] { return TJTAB; }
\-{digit}+ {
(void)sscanf(yytext, "%d", &token.ival);
return NUMBER;
}
{digit}+ { {digit}+ {
(void)sscanf(yytext, "%d", &token.ival); (void)sscanf(yytext, "%d", &token.ival);
return NUMBER; return NUMBER;

80
main.c
View File

@ -1,8 +1,8 @@
/* /*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
* *
* $Id$ * $Id: main.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2003, 2008 Eric Smith <eric@brouhaha.com> * Copyright 2000-2016 Eric Smith <eric@brouhaha.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -24,6 +24,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "dis.h" #include "dis.h"
@ -50,13 +51,6 @@ int jtab2_addr_high [JTAB2_MAX]; /* .jtab2 directive */
int jtab2_size [JTAB2_MAX]; int jtab2_size [JTAB2_MAX];
int jtab2_count = 0; int jtab2_count = 0;
#define JTAB_MAX 50
int jtab_addr [JTAB_MAX]; /* .jtab directive */
int jtab_addr [JTAB_MAX];
int jtab_size [JTAB_MAX];
int jtab_offset [JTAB_MAX];
int jtab_count = 0;
VALUE token; VALUE token;
unsigned char d[0x10000]; /* The data */ unsigned char d[0x10000]; /* The data */
@ -103,7 +97,7 @@ void trace_inst (addr_t addr)
opcode = getbyte(addr); opcode = getbyte(addr);
ip = &optbl[opcode]; ip = &optbl[opcode];
if (ip->flag & ILL) if (! (ip->flag & ADRMASK)) // illegal if no address mode
return; return;
f[addr] |= ISOP; f[addr] |= ISOP;
@ -137,6 +131,7 @@ void trace_inst (addr_t addr)
case IMP: case IMP:
case REL: case REL:
case IND: case IND:
case INZ:
break; break;
case ABS: case ABS:
if (ip->flag & (JUMP | FORK)) if (ip->flag & (JUMP | FORK))
@ -161,9 +156,13 @@ void trace_inst (addr_t addr)
switch (ip->flag & CTLMASK) switch (ip->flag & CTLMASK)
{ {
case NORM:
break;
case JUMP: case JUMP:
if (ip->flag & REL)
{
if (operand > 127)
operand = (~0xff | operand);
operand = operand + addr;
}
f[operand] |= JREF; f[operand] |= JREF;
save_ref(istart, operand); save_ref(istart, operand);
add_trace(operand); add_trace(operand);
@ -186,7 +185,7 @@ void trace_inst (addr_t addr)
case STOP: case STOP:
return; return;
default: default:
crash("Optable error"); break;
} }
} }
} }
@ -259,23 +258,6 @@ void do_jtab2 (void)
} }
} }
void do_jtab (void)
{
int i, j;
int loc, code;
for (i = 0; i < jtab_count; i++)
{
loc = jtab_addr [i];
for (j = 0; j < jtab_size [i]; j+=2)
{
char *trace_sym = (char *) malloc (6);
code = (d [loc + j] + (d [loc + j + 1] << 8)) - jtab_offset [i];
sprintf (trace_sym, "T%04x", code);
start_trace (code, trace_sym);
}
}
}
int main (int argc, char *argv[]) int main (int argc, char *argv[])
@ -314,7 +296,6 @@ int main (int argc, char *argv[])
do_ptrace (); do_ptrace ();
do_rtstab (); do_rtstab ();
do_jtab2 (); do_jtab2 ();
do_jtab ();
trace_all (); trace_all ();
@ -372,23 +353,6 @@ void get_predef (void)
crash(".jtab2 needs a number operand"); crash(".jtab2 needs a number operand");
jtab2_size [jtab2_count++] = token.ival; jtab2_size [jtab2_count++] = token.ival;
break; break;
case TJTAB:
if (yylex() != NUMBER)
crash(".jtab needs a number operand");
if (token.ival > 0x10000 || token.ival < 0)
crash("Number out of range");
jtab_addr [jtab_count] = token.ival;
if (yylex() != ',')
crash(".jtab needs a comma");
if (yylex() != NUMBER)
crash(".jtab2 needs a number operand");
jtab_size [jtab_count] = token.ival;
if (yylex() != ',')
crash(".jtab needs a comma");
if (yylex() != NUMBER)
crash(".jtab2 needs a number operand");
jtab_offset [jtab_count++] = token.ival;
break;
case TSTART: case TSTART:
if (yylex() != NUMBER) if (yylex() != NUMBER)
crash(".trace needs a number operand"); crash(".trace needs a number operand");
@ -637,9 +601,23 @@ void binaryloadfile (void)
fprintf (stderr, "base: %04x reset: %04x irq: %04x nmi: %04x\n", base_address, reset, irq, nmi); fprintf (stderr, "base: %04x reset: %04x irq: %04x nmi: %04x\n", base_address, reset, irq, nmi);
start_trace ((d [reset+1] << 8) | d [reset], "RESET"); if (entry_count)
start_trace ((d [irq +1] << 8) | d [irq ], "IRQ"); {
start_trace ((d [nmi +1] << 8) | d [nmi ], "NMI"); int i;
char label [8];
for (i = 0; i < entry_count; i++)
{
snprintf (label, sizeof (label), "e_%04x", entry_address[i]);
printf("label: %s\n", label);
start_trace (entry_address[i], label);
}
}
else
{
start_trace ((d [reset+1] << 8) | d [reset], "RESET");
start_trace ((d [irq +1] << 8) | d [irq ], "IRQ");
start_trace ((d [nmi +1] << 8) | d [nmi ], "NMI");
}
} }
int int

View File

@ -1,8 +1,8 @@
/* /*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
* *
* $Id: print.c,v 1.8 2003/09/16 12:00:00 eric Exp $ * $Id: print.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2003 Eric Smith <eric@brouhaha.com> * Copyright 2000-2014 Eric Smith <eric@brouhaha.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -210,6 +210,7 @@ int print_inst(addr_t addr)
printf("\t%s", lname(operand, 1)); printf("\t%s", lname(operand, 1));
break; break;
case IND: case IND:
case INZ:
printf("\t(%s)", lname(operand, 1)); printf("\t(%s)", lname(operand, 1));
break; break;
case ABX: case ABX:

510
tbl.c
View File

@ -1,8 +1,8 @@
/* /*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
* *
* $Id: tbl.c,v 1.4 2003/09/15 21:49:25 eric Exp $ * $Id: tbl.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2001-2003 Eric Smith <eric@brouhaha.com> * Copyright 2001-2014 Eric Smith <eric@brouhaha.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -27,260 +27,254 @@
#include "dis.h" #include "dis.h"
struct info optbl[256] = { struct info optbl[256] = {
/* 00 */ { { 'B', 'R', 'K', 0, }, 1, IMP|STOP, }, [0x00] = { "brk", 1, IMP|JUMP },
/* 01 */ { { 'O', 'R', 'A', 0, }, 2, INX|NORM, }, [0x01] = { "ora", 2, INX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x05] = { "ora", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x06] = { "asl", 2, ZPG },
/* 05 */ { { 'O', 'R', 'A', 0, }, 2, ZPG|NORM, },
/* 06 */ { { 'A', 'S', 'L', 0, }, 2, ZPG|NORM, }, [0x08] = { "php", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x09] = { "ora", 2, IMM },
/* 08 */ { { 'P', 'H', 'P', 0, }, 1, IMP|NORM, }, [0x0a] = { "asl", 1, ACC },
/* 09 */ { { 'O', 'R', 'A', 0, }, 2, IMM|NORM, },
/* 0a */ { { 'A', 'S', 'L', 0, }, 1, ACC|NORM, }, [0x0d] = { "ora", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x0e] = { "asl", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 0d */ { { 'O', 'R', 'A', 0, }, 3, ABS|NORM, }, [0x10] = { "bpl", 2, REL|FORK },
/* 0e */ { { 'A', 'S', 'L', 0, }, 3, ABS|NORM, }, [0x11] = { "ora", 2, INY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 10 */ { { 'B', 'P', 'L', 0, }, 2, REL|FORK, }, [0x15] = { "ora", 2, ZPX },
/* 11 */ { { 'O', 'R', 'A', 0, }, 2, INY|NORM, }, [0x16] = { "asl", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x18] = { "clc", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x19] = { "ora", 3, ABY },
/* 15 */ { { 'O', 'R', 'A', 0, }, 2, ZPX|NORM, },
/* 16 */ { { 'A', 'S', 'L', 0, }, 2, ZPX|NORM, }, [0x1d] = { "ora", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x1e] = { "asl", 3, ABX },
/* 18 */ { { 'C', 'L', 'C', 0, }, 1, IMP|NORM, },
/* 19 */ { { 'O', 'R', 'A', 0, }, 3, ABY|NORM, }, [0x20] = { "jsr", 3, ABS|FORK },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x21] = { "and", 2, INX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x24] = { "bit", 2, ZPG },
/* 1d */ { { 'O', 'R', 'A', 0, }, 3, ABX|NORM, }, [0x25] = { "and", 2, ZPG },
/* 1e */ { { 'A', 'S', 'L', 0, }, 3, ABX|NORM, }, [0x26] = { "rol", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 20 */ { { 'J', 'S', 'R', 0, }, 3, ABS|FORK, }, [0x28] = { "plp", 1, IMP },
/* 21 */ { { 'A', 'N', 'D', 0, }, 2, INX|NORM, }, [0x29] = { "and", 2, IMM },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x2a] = { "rol", 1, ACC },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 24 */ { { 'B', 'I', 'T', 0, }, 2, ZPG|NORM, }, [0x2c] = { "bit", 3, ABS },
/* 25 */ { { 'A', 'N', 'D', 0, }, 2, ZPG|NORM, }, [0x2d] = { "and", 3, ABS },
/* 26 */ { { 'R', 'O', 'L', 0, }, 2, ZPG|NORM, }, [0x2e] = { "rol", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 28 */ { { 'P', 'L', 'P', 0, }, 1, IMP|NORM, }, [0x30] = { "bmi", 2, REL|FORK },
/* 29 */ { { 'A', 'N', 'D', 0, }, 2, IMM|NORM, }, [0x31] = { "and", 2, INY },
/* 2a */ { { 'R', 'O', 'L', 0, }, 1, ACC|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x35] = { "and", 2, ZPX },
/* 2c */ { { 'B', 'I', 'T', 0, }, 3, ABS|NORM, }, [0x36] = { "rol", 2, ZPX },
/* 2d */ { { 'A', 'N', 'D', 0, }, 3, ABS|NORM, },
/* 2e */ { { 'R', 'O', 'L', 0, }, 3, ABS|NORM, }, [0x38] = { "sec", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x39] = { "and", 3, ABY },
/* 30 */ { { 'B', 'M', 'I', 0, }, 2, REL|FORK, },
/* 31 */ { { 'A', 'N', 'D', 0, }, 2, INY|NORM, }, [0x3d] = { "and", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x3e] = { "rol", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x40] = { "rti", 1, IMP|STOP },
/* 35 */ { { 'A', 'N', 'D', 0, }, 2, ZPX|NORM, }, [0x41] = { "eor", 2, INX },
/* 36 */ { { 'R', 'O', 'L', 0, }, 2, ZPX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x45] = { "eor", 2, ZPG },
/* 38 */ { { 'S', 'E', 'C', 0, }, 1, IMP|NORM, },
/* 39 */ { { 'A', 'N', 'D', 0, }, 3, ABY|NORM, }, [0x48] = { "pha", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x49] = { "eor", 2, IMM },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x4a] = { "lsr", 1, ACC },
/* 3d */ { { 'A', 'N', 'D', 0, }, 3, ABX|NORM, },
/* 3e */ { { 'R', 'O', 'L', 0, }, 3, ABX|NORM, }, [0x4c] = { "jmp", 3, ABS|JUMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x4d] = { "eor", 3, ABS },
/* 40 */ { { 'R', 'T', 'I', 0, }, 1, IMP|STOP, }, [0x4e] = { "lsr", 3, ABS },
/* 41 */ { { 'E', 'O', 'R', 0, }, 2, INX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x50] = { "bvc", 2, REL|FORK },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x51] = { "eor", 2, INY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 45 */ { { 'E', 'O', 'R', 0, }, 2, ZPG|NORM, }, [0x55] = { "eor", 2, ZPX },
/* 46 */ { { 'L', 'S', 'R', 0, }, 2, ZPG|NORM, }, [0x56] = { "lsr", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 48 */ { { 'P', 'H', 'A', 0, }, 1, IMP|NORM, }, [0x58] = { "cli", 1, IMP },
/* 49 */ { { 'E', 'O', 'R', 0, }, 2, IMM|NORM, }, [0x59] = { "eor", 3, ABY },
/* 4a */ { { 'L', 'S', 'R', 0, }, 1, ACC|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x5d] = { "eor", 3, ABX },
/* 4c */ { { 'J', 'M', 'P', 0, }, 3, ABS|JUMP, }, [0x5e] = { "lsr", 3, ABX },
/* 4d */ { { 'E', 'O', 'R', 0, }, 3, ABS|NORM, },
/* 4e */ { { 'L', 'S', 'R', 0, }, 3, ABS|NORM, }, [0x60] = { "rts", 1, IMP|STOP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x61] = { "adc", 2, INX },
/* 50 */ { { 'B', 'V', 'C', 0, }, 2, REL|FORK, },
/* 51 */ { { 'E', 'O', 'R', 0, }, 2, INY|NORM, }, [0x65] = { "adc", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x66] = { "ror", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x68] = { "pla", 1, IMP },
/* 55 */ { { 'E', 'O', 'R', 0, }, 2, ZPX|NORM, }, [0x69] = { "adc", 2, IMM },
/* 56 */ { { 'L', 'S', 'R', 0, }, 2, ZPX|NORM, }, [0x6a] = { "ror", 1, ACC },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 58 */ { { 'C', 'L', 'I', 0, }, 1, IMP|NORM, }, [0x6c] = { "jmp", 3, IND|STOP },
/* 59 */ { { 'E', 'O', 'R', 0, }, 3, ABY|NORM, }, [0x6d] = { "adc", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x6e] = { "ror", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x70] = { "bvs", 2, REL|FORK },
/* 5d */ { { 'E', 'O', 'R', 0, }, 3, ABX|NORM, }, [0x71] = { "adc", 2, INY },
/* 5e */ { { 'L', 'S', 'R', 0, }, 3, ABX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x75] = { "adc", 2, ZPX },
/* 60 */ { { 'R', 'T', 'S', 0, }, 1, IMP|STOP, }, [0x76] = { "ror", 2, ZPX },
/* 61 */ { { 'A', 'D', 'C', 0, }, 2, INX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x78] = { "sei", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x79] = { "adc", 3, ABY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 65 */ { { 'A', 'D', 'C', 0, }, 2, ZPG|NORM, }, [0x7d] = { "adc", 3, ABX },
/* 66 */ { { 'R', 'O', 'R', 0, }, 2, ZPG|NORM, }, [0x7e] = { "ror", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 68 */ { { 'P', 'L', 'A', 0, }, 1, IMP|NORM, }, [0x81] = { "sta", 2, INX },
/* 69 */ { { 'A', 'D', 'C', 0, }, 2, IMM|NORM, },
/* 6a */ { { 'R', 'O', 'R', 0, }, 1, ACC|NORM, }, [0x84] = { "sty", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x85] = { "sta", 2, ZPG },
/* 6c */ { { 'J', 'M', 'P', 0, }, 3, IND|STOP, }, [0x86] = { "stx", 2, ZPG },
/* 6d */ { { 'A', 'D', 'C', 0, }, 3, ABS|NORM, },
/* 6e */ { { 'R', 'O', 'R', 0, }, 3, ABS|NORM, }, [0x88] = { "dey", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 70 */ { { 'B', 'V', 'S', 0, }, 2, REL|FORK, }, [0x8a] = { "txa", 1, IMP },
/* 71 */ { { 'A', 'D', 'C', 0, }, 2, INY|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x8c] = { "sty", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x8d] = { "sta", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x8e] = { "stx", 3, ABS },
/* 75 */ { { 'A', 'D', 'C', 0, }, 2, ZPX|NORM, },
/* 76 */ { { 'R', 'O', 'R', 0, }, 2, ZPX|NORM, }, [0x90] = { "bcc", 2, REL|FORK },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x91] = { "sta", 2, INY },
/* 78 */ { { 'S', 'E', 'I', 0, }, 1, IMP|NORM, },
/* 79 */ { { 'A', 'D', 'C', 0, }, 3, ABY|NORM, }, [0x94] = { "sty", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x95] = { "sta", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x96] = { "stx", 2, ZPY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 7d */ { { 'A', 'D', 'C', 0, }, 3, ABX|NORM, }, [0x98] = { "tya", 1, IMP },
/* 7e */ { { 'R', 'O', 'R', 0, }, 3, ABX|NORM, }, [0x99] = { "sta", 3, ABY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x9a] = { "txs", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 81 */ { { 'S', 'T', 'A', 0, }, 2, INX|NORM, }, [0x9d] = { "sta", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xa0] = { "ldy", 2, IMM },
/* 84 */ { { 'S', 'T', 'Y', 0, }, 2, ZPG|NORM, }, [0xa1] = { "lda", 2, INX },
/* 85 */ { { 'S', 'T', 'A', 0, }, 2, ZPG|NORM, }, [0xa2] = { "ldx", 2, IMM },
/* 86 */ { { 'S', 'T', 'X', 0, }, 2, ZPG|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xa4] = { "ldy", 2, ZPG },
/* 88 */ { { 'D', 'E', 'Y', 0, }, 1, IMP|NORM, }, [0xa5] = { "lda", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xa6] = { "ldx", 2, ZPG },
/* 8a */ { { 'T', 'X', 'A', 0, }, 1, IMP|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xa8] = { "tay", 1, IMP },
/* 8c */ { { 'S', 'T', 'Y', 0, }, 3, ABS|NORM, }, [0xa9] = { "lda", 2, IMM },
/* 8d */ { { 'S', 'T', 'A', 0, }, 3, ABS|NORM, }, [0xaa] = { "tax", 1, IMP },
/* 8e */ { { 'S', 'T', 'X', 0, }, 3, ABS|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xac] = { "ldy", 3, ABS },
/* 90 */ { { 'B', 'C', 'C', 0, }, 2, REL|FORK, }, [0xad] = { "lda", 3, ABS },
/* 91 */ { { 'S', 'T', 'A', 0, }, 2, INY|NORM, }, [0xae] = { "ldx", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xb0] = { "bcs", 2, REL|FORK },
/* 94 */ { { 'S', 'T', 'Y', 0, }, 2, ZPX|NORM, }, [0xb1] = { "lda", 2, INY },
/* 95 */ { { 'S', 'T', 'A', 0, }, 2, ZPX|NORM, },
/* 96 */ { { 'S', 'T', 'X', 0, }, 2, ZPY|NORM, }, [0xb4] = { "ldy", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xb5] = { "lda", 2, ZPX },
/* 98 */ { { 'T', 'Y', 'A', 0, }, 1, IMP|NORM, }, [0xb6] = { "ldx", 2, ZPY },
/* 99 */ { { 'S', 'T', 'A', 0, }, 3, ABY|NORM, },
/* 9a */ { { 'T', 'X', 'S', 0, }, 1, IMP|NORM, }, [0xb8] = { "clv", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xb9] = { "lda", 3, ABY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xba] = { "tsx", 1, IMP },
/* 9d */ { { 'S', 'T', 'A', 0, }, 3, ABX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xbc] = { "ldy", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xbd] = { "lda", 3, ABX },
/* a0 */ { { 'L', 'D', 'Y', 0, }, 2, IMM|NORM, }, [0xbe] = { "ldx", 3, ABY },
/* a1 */ { { 'L', 'D', 'A', 0, }, 2, INX|NORM, },
/* a2 */ { { 'L', 'D', 'X', 0, }, 2, IMM|NORM, }, [0xc0] = { "cpy", 2, IMM },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xc1] = { "cmp", 2, INX },
/* a4 */ { { 'L', 'D', 'Y', 0, }, 2, ZPG|NORM, },
/* a5 */ { { 'L', 'D', 'A', 0, }, 2, ZPG|NORM, }, [0xc4] = { "cpy", 2, ZPG },
/* a6 */ { { 'L', 'D', 'X', 0, }, 2, ZPG|NORM, }, [0xc5] = { "cmp", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xc6] = { "dec", 2, ZPG },
/* a8 */ { { 'T', 'A', 'Y', 0, }, 1, IMP|NORM, },
/* a9 */ { { 'L', 'D', 'A', 0, }, 2, IMM|NORM, }, [0xc8] = { "iny", 1, IMP },
/* aa */ { { 'T', 'A', 'X', 0, }, 1, IMP|NORM, }, [0xc9] = { "cmp", 2, IMM },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xca] = { "dex", 1, IMP },
/* ac */ { { 'L', 'D', 'Y', 0, }, 3, ABS|NORM, },
/* ad */ { { 'L', 'D', 'A', 0, }, 3, ABS|NORM, }, [0xcc] = { "cpy", 3, ABS },
/* ae */ { { 'L', 'D', 'X', 0, }, 3, ABS|NORM, }, [0xcd] = { "cmp", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xce] = { "dec", 3, ABS },
/* b0 */ { { 'B', 'C', 'S', 0, }, 2, REL|FORK, },
/* b1 */ { { 'L', 'D', 'A', 0, }, 2, INY|NORM, }, [0xd0] = { "bne", 2, REL|FORK },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xd1] = { "cmp", 2, INY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* b4 */ { { 'L', 'D', 'Y', 0, }, 2, ZPX|NORM, }, [0xd5] = { "cmp", 2, ZPX },
/* b5 */ { { 'L', 'D', 'A', 0, }, 2, ZPX|NORM, }, [0xd6] = { "dec", 2, ZPX },
/* b6 */ { { 'L', 'D', 'X', 0, }, 2, ZPY|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xd8] = { "cld", 1, IMP },
/* b8 */ { { 'C', 'L', 'V', 0, }, 1, IMP|NORM, }, [0xd9] = { "cmp", 3, ABY },
/* b9 */ { { 'L', 'D', 'A', 0, }, 3, ABY|NORM, },
/* ba */ { { 'T', 'S', 'X', 0, }, 1, IMP|NORM, }, [0xdd] = { "cmp", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xde] = { "dec", 3, ABX },
/* bc */ { { 'L', 'D', 'Y', 0, }, 3, ABX|NORM, },
/* bd */ { { 'L', 'D', 'A', 0, }, 3, ABX|NORM, }, [0xe0] = { "cpx", 2, IMM },
/* be */ { { 'L', 'D', 'X', 0, }, 3, ABY|NORM, }, [0xe1] = { "sbc", 2, INX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* c0 */ { { 'C', 'P', 'Y', 0, }, 2, IMM|NORM, }, [0xe4] = { "cpx", 2, ZPG },
/* c1 */ { { 'C', 'M', 'P', 0, }, 2, INX|NORM, }, [0xe5] = { "sbc", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xe6] = { "inc", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* c4 */ { { 'C', 'P', 'Y', 0, }, 2, ZPG|NORM, }, [0xe8] = { "inx", 1, IMP },
/* c5 */ { { 'C', 'M', 'P', 0, }, 2, ZPG|NORM, }, [0xe9] = { "sbc", 2, IMM },
/* c6 */ { { 'D', 'E', 'C', 0, }, 2, ZPG|NORM, }, [0xea] = { "nop", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* c8 */ { { 'I', 'N', 'Y', 0, }, 1, IMP|NORM, }, [0xec] = { "cpx", 3, ABS },
/* c9 */ { { 'C', 'M', 'P', 0, }, 2, IMM|NORM, }, [0xed] = { "sbc", 3, ABS },
/* ca */ { { 'D', 'E', 'X', 0, }, 1, IMP|NORM, }, [0xee] = { "inc", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* cc */ { { 'C', 'P', 'Y', 0, }, 3, ABS|NORM, }, [0xf0] = { "beq", 2, REL|FORK },
/* cd */ { { 'C', 'M', 'P', 0, }, 3, ABS|NORM, }, [0xf1] = { "sbc", 2, INY },
/* ce */ { { 'D', 'E', 'C', 0, }, 3, ABS|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xf5] = { "sbc", 2, ZPX },
/* d0 */ { { 'B', 'N', 'E', 0, }, 2, REL|FORK, }, [0xf6] = { "inc", 2, ZPX },
/* d1 */ { { 'C', 'M', 'P', 0, }, 2, INY|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xf8] = { "sed", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xf9] = { "sbc", 3, ABY },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* d5 */ { { 'C', 'M', 'P', 0, }, 2, ZPX|NORM, }, [0xfd] = { "sbc", 3, ABX },
/* d6 */ { { 'D', 'E', 'C', 0, }, 2, ZPX|NORM, }, [0xfe] = { "inc", 3, ABX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* d8 */ { { 'C', 'L', 'D', 0, }, 1, IMP|NORM, }, #if 1
/* d9 */ { { 'C', 'M', 'P', 0, }, 3, ABY|NORM, }, // 65C02
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x04] = { "tsb", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x0c] = { "tsb", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x12] = { "ora", 2, INZ },
/* dd */ { { 'C', 'M', 'P', 0, }, 3, ABX|NORM, }, [0x14] = { "trb", 2, ZPG },
/* de */ { { 'D', 'E', 'C', 0, }, 3, ABX|NORM, }, [0x1a] = { "inc", 1, ACC },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x1c] = { "trb", 3, ABS },
/* e0 */ { { 'C', 'P', 'X', 0, }, 2, IMM|NORM, }, [0x32] = { "and", 2, INZ },
/* e1 */ { { 'S', 'B', 'C', 0, }, 2, INX|NORM, }, [0x34] = { "bit", 2, ZPX },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x3a] = { "dec", 1, ACC },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x3c] = { "bit", 3, ABX },
/* e4 */ { { 'C', 'P', 'X', 0, }, 2, ZPG|NORM, }, [0x52] = { "eor", 2, INZ },
/* e5 */ { { 'S', 'B', 'C', 0, }, 2, ZPG|NORM, }, [0x5a] = { "phy", 1, IMP },
/* e6 */ { { 'I', 'N', 'C', 0, }, 2, ZPG|NORM, }, [0x64] = { "stz", 2, ZPG },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x72] = { "adc", 2, INZ },
/* e8 */ { { 'I', 'N', 'X', 0, }, 1, IMP|NORM, }, [0x74] = { "stz", 2, ZPX },
/* e9 */ { { 'S', 'B', 'C', 0, }, 2, IMM|NORM, }, [0x7a] = { "ply", 1, IMP },
/* ea */ { { 'N', 'O', 'P', 0, }, 1, IMP|NORM, }, [0x7c] = { "jmp", 3, ABX|STOP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x80] = { "bra", 2, REL|JUMP },
/* ec */ { { 'C', 'P', 'X', 0, }, 3, ABS|NORM, }, [0x89] = { "bit", 2, IMM },
/* ed */ { { 'S', 'B', 'C', 0, }, 3, ABS|NORM, }, [0x92] = { "sta", 2, INZ },
/* ee */ { { 'I', 'N', 'C', 0, }, 3, ABS|NORM, }, [0x9c] = { "stz", 3, ABS },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0x9e] = { "stz", 3, ABX },
/* f0 */ { { 'B', 'E', 'Q', 0, }, 2, REL|FORK, }, [0xb2] = { "lda", 2, INZ },
/* f1 */ { { 'S', 'B', 'C', 0, }, 2, INY|NORM, }, [0xd2] = { "cmp", 2, INZ },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xda] = { "phx", 1, IMP },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xf2] = { "sbc", 2, INZ },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, [0xfa] = { "plx", 1, IMP },
/* f5 */ { { 'S', 'B', 'C', 0, }, 2, ZPX|NORM, }, #endif
/* f6 */ { { 'I', 'N', 'C', 0, }, 2, ZPX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, }, #if 0
/* f8 */ { { 'S', 'E', 'D', 0, }, 1, IMP|NORM, }, // Rockwell bit instructions
/* f9 */ { { 'S', 'B', 'C', 0, }, 3, ABY|NORM, }, #endif
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
/* fd */ { { 'S', 'B', 'C', 0, }, 3, ABX|NORM, },
/* fe */ { { 'I', 'N', 'C', 0, }, 3, ABX|NORM, },
/* 00 */ { { '?', '?', '?', 0, }, 1, ILL|NORM, },
}; };