[mod.sources] v07i098: Generic assembler for micros, Part02/02

sources-request@mirror.TMC.COM (01/20/87)

Submitted by: seismo!cisden!lmc
Mod.sources: Volume 7, Issue 98
Archive-name: micro.asm/Part02

[  Sorry about sending out that previous archive with intial tilde's
   in it; makes it hard to send things via /usr/ucb/Mail, I know.  -r$  ]

: This is a shar archieve.  Extract with sh, not csh.
: The rest of this file will extract:
: 6502_ops.h 6803_ops.h 8085_ops.h
echo extracting - 6502_ops.h
sed 's/^X//' > 6502_ops.h << '/FUNKY/STUFF/'
X#define c64 1
X
Xopdclass  o_immed  =  { 8,  NO,  NO,  NO,  0};
Xopdclass  o_zpage  =  { 8,  NO,  NO,  NO,  0};
Xopdclass  o_mem    =  { 16, NO, YES,  NO,  0};
Xopdclass  o_rel    =  { 8, YES,  NO, YES,  0};
X
Xinsclass  i_nomem  =  { 1, 0,  &o_none, &o_none, 0, 0};
Xinsclass  i_branch =  { 2, 1,   &o_rel, &o_none, 8, 0};
Xinsclass  i_immed  =  { 2, 1, &o_immed, &o_none, 8, 0};
Xinsclass  i_zpage  =  { 2, 1, &o_zpage, &o_none, 8, 0};
Xinsclass  i_abs    =  { 3, 1,   &o_mem, &o_none, 8, 0};
X
Xopdef optab[] = {
X	{ "adci",	&i_immed,	0x69,	geninstr},
X	{ "adcz",	&i_zpage,	0x65,	geninstr},
X	{ "adczx",	&i_zpage,	0x75,	geninstr},
X	{ "adca",	&i_abs,	0x6d,	geninstr},
X	{ "adcax",	&i_abs,	0x7d,	geninstr},
X	{ "adcay",	&i_abs,	0x79,	geninstr},
X	{ "adcix",	&i_abs,	0x61,	geninstr},
X	{ "adciy",	&i_abs,	0x71,	geninstr},
X	{ "andi",	&i_immed,	0x29,	geninstr},
X	{ "andz",	&i_zpage,	0x25,	geninstr},
X	{ "andzx",	&i_zpage,	0x35,	geninstr},
X	{ "anda",	&i_abs,	0x2d,	geninstr},
X	{ "andax",	&i_abs,	0x3d,	geninstr},
X	{ "anday",	&i_abs,	0x39,	geninstr},
X	{ "andix",	&i_abs,	0x21,	geninstr},
X	{ "andiy",	&i_abs,	0x31,	geninstr},
X	{ "aslac",	&i_nomem,	0x0a,	geninstr},
X	{ "aslz",	&i_zpage,	0x06,	geninstr},
X	{ "aslzx",	&i_zpage,	0x16,	geninstr},
X	{ "asla",	&i_abs,	0x0e,	geninstr},
X	{ "aslax",	&i_abs,	0x1e,	geninstr},
X	{ "bcc",	&i_branch,	0x90,	geninstr},
X	{ "bcs",	&i_branch,	0xb0,	geninstr},
X	{ "beq",	&i_branch,	0xf0,	geninstr},
X	{ "bitz",	&i_zpage,	0x24,	geninstr},
X	{ "bita",	&i_abs,	0x2c,	geninstr},
X	{ "bmi",	&i_branch,	0x30,	geninstr},
X	{ "bne",	&i_branch,	0xd0,	geninstr},
X	{ "bpl",	&i_branch,	0x10,	geninstr},
X	{ "brk",	&i_nomem,	0x00,	geninstr},
X	{ "bvc",	&i_branch,	0x50,	geninstr},
X	{ "bvs",	&i_branch,	0x70,	geninstr},
X	{ "clc",	&i_nomem,	0x18,	geninstr},
X	{ "cld",	&i_nomem,	0xd8,	geninstr},
X	{ "cli",	&i_nomem,	0x58,	geninstr},
X	{ "clv",	&i_nomem,	0xb8,	geninstr},
X	{ "cmpi",	&i_immed,	0xc9,	geninstr},
X	{ "cmpz",	&i_zpage,	0xc5,	geninstr},
X	{ "cmpzx",	&i_zpage,	0xd5,	geninstr},
X	{ "cmpa",	&i_abs,	0xcd,	geninstr},
X	{ "cmpax",	&i_abs,	0xdd,	geninstr},
X	{ "cmpay",	&i_abs,	0xd9,	geninstr},
X	{ "cmpix",	&i_abs,	0xc1,	geninstr},
X	{ "cmpiy",	&i_abs,	0xd1,	geninstr},
X	{ "cpxi",	&i_immed,	0xe0,	geninstr},
X	{ "cpxz",	&i_zpage,	0xe4,	geninstr},
X	{ "cpxa",	&i_abs,	0xec,	geninstr},
X	{ "cpyi",	&i_immed,	0xc0,	geninstr},
X	{ "cpyz",	&i_zpage,	0xc4,	geninstr},
X	{ "cpya",	&i_abs,	0xcc,	geninstr},
X	{ "decz",	&i_zpage,	0xc6,	geninstr},
X	{ "deczx",	&i_zpage,	0xd6,	geninstr},
X	{ "deca",	&i_abs,	0xce,	geninstr},
X	{ "decax",	&i_abs,	0xde,	geninstr},
X	{ "dex",	&i_nomem,	0xca,	geninstr},
X	{ "dey",	&i_nomem,	0x88,	geninstr},
X	{ "eori",	&i_immed,	0x49,	geninstr},
X	{ "eorz",	&i_zpage,	0x45,	geninstr},
X	{ "eorzx",	&i_zpage,	0x55,	geninstr},
X	{ "eora",	&i_abs,	0x4d,	geninstr},
X	{ "eorax",	&i_abs,	0x5d,	geninstr},
X	{ "eoray",	&i_abs,	0x59,	geninstr},
X	{ "eorix",	&i_abs,	0x41,	geninstr},
X	{ "eoriy",	&i_abs,	0x51,	geninstr},
X	{ "incz",	&i_zpage,	0xe6,	geninstr},
X	{ "inczx",	&i_zpage,	0xf6,	geninstr},
X	{ "inca",	&i_abs,	0xee,	geninstr},
X	{ "incax",	&i_abs,	0xfe,	geninstr},
X	{ "inx",	&i_nomem,	0xe8,	geninstr},
X	{ "iny",	&i_nomem,	0xc8,	geninstr},
X	{ "jmp",	&i_abs,	0x4c,	geninstr},
X	{ "jmpi",	&i_abs,	0x6c,	geninstr},
X	{ "jsr",	&i_abs,	0x20,	geninstr},
X	{ "ldai",	&i_immed,	0xa9,	geninstr},
X	{ "ldaz",	&i_zpage,	0xa5,	geninstr},
X	{ "ldazx",	&i_zpage,	0xb5,	geninstr},
X	{ "ldaa",	&i_abs,	0xad,	geninstr},
X	{ "ldaax",	&i_abs,	0xbd,	geninstr},
X	{ "ldaay",	&i_abs,	0xb9,	geninstr},
X	{ "ldaix",	&i_abs,	0xa1,	geninstr},
X	{ "ldaiy",	&i_abs,	0xb1,	geninstr},
X	{ "ldxi",	&i_immed,	0xa2,	geninstr},
X	{ "ldxz",	&i_zpage,	0xa6,	geninstr},
X	{ "ldxzy",	&i_zpage,	0xb6,	geninstr},
X	{ "ldxa",	&i_abs,	0xae,	geninstr},
X	{ "ldxay",	&i_abs,	0xbe,	geninstr},
X	{ "ldyi",	&i_immed,	0xa0,	geninstr},
X	{ "ldyz",	&i_zpage,	0xa4,	geninstr},
X	{ "ldyzx",	&i_zpage,	0xb4,	geninstr},
X	{ "ldya",	&i_abs,	0xac,	geninstr},
X	{ "ldyax",	&i_abs,	0xbc,	geninstr},
X	{ "lsrac",	&i_nomem,	0x4a,	geninstr},
X	{ "lsrz",	&i_zpage,	0x46,	geninstr},
X	{ "lsrzx",	&i_zpage,	0x56,	geninstr},
X	{ "lsra",	&i_abs,	0x4e,	geninstr},
X	{ "lsrax",	&i_abs,	0x5e,	geninstr},
X	{ "nop",	&i_nomem,	0xea,	geninstr},
X	{ "orai",	&i_immed,	0x09,	geninstr},
X	{ "oraz",	&i_zpage,	0x05,	geninstr},
X	{ "orazx",	&i_zpage,	0x15,	geninstr},
X	{ "oraa",	&i_abs,	0x0d,	geninstr},
X	{ "oraax",	&i_abs,	0x1d,	geninstr},
X	{ "oraay",	&i_abs,	0x19,	geninstr},
X	{ "oraix",	&i_abs,	0x01,	geninstr},
X	{ "oraiy",	&i_abs,	0x11,	geninstr},
X	{ "pha",	&i_nomem,	0x48,	geninstr},
X	{ "php",	&i_nomem,	0x08,	geninstr},
X	{ "pla",	&i_nomem,	0x68,	geninstr},
X	{ "plp",	&i_nomem,	0x28,	geninstr},
X	{ "rolac",	&i_nomem,	0x2a,	geninstr},
X	{ "rolz",	&i_zpage,	0x26,	geninstr},
X	{ "rolzx",	&i_zpage,	0x36,	geninstr},
X	{ "rola",	&i_abs,	0x2e,	geninstr},
X	{ "rolax",	&i_abs,	0x3e,	geninstr},
X	{ "rorac",	&i_nomem,	0x6a,	geninstr},
X	{ "rorz",	&i_zpage,	0x66,	geninstr},
X	{ "rorzx",	&i_zpage,	0x76,	geninstr},
X	{ "rora",	&i_abs,	0x6e,	geninstr},
X	{ "rorax",	&i_abs,	0x7e,	geninstr},
X	{ "rti",	&i_nomem,	0x40,	geninstr},
X	{ "rst",	&i_nomem,	0x60,	geninstr},
X	{ "sbci",	&i_immed,	0xe9,	geninstr},
X	{ "sbcz",	&i_zpage,	0xe5,	geninstr},
X	{ "sbczx",	&i_zpage,	0xf5,	geninstr},
X	{ "sbca",	&i_abs,	0xed,	geninstr},
X	{ "sbcax",	&i_abs,	0xfd,	geninstr},
X	{ "sbcay",	&i_abs,	0xf9,	geninstr},
X	{ "sbcix",	&i_abs,	0xe1,	geninstr},
X	{ "sbciy",	&i_abs,	0xf1,	geninstr},
X	{ "sec",	&i_nomem,	0x38,	geninstr},
X	{ "sed",	&i_nomem,	0xf8,	geninstr},
X	{ "sei",	&i_nomem,	0x78,	geninstr},
X	{ "staz",	&i_zpage,	0x85,	geninstr},
X	{ "stazx",	&i_zpage,	0x95,	geninstr},
X	{ "staa",	&i_abs,	0x8d,	geninstr},
X	{ "staax",	&i_abs,	0x9d,	geninstr},
X	{ "staay",	&i_abs,	0x99,	geninstr},
X	{ "staix",	&i_abs,	0x81,	geninstr},
X	{ "staiy",	&i_abs,	0x91,	geninstr},
X	{ "stxz",	&i_zpage,	0x86,	geninstr},
X	{ "stxzy",	&i_zpage,	0x96,	geninstr},
X	{ "stxa",	&i_abs,	0x8e,	geninstr},
X	{ "styz",	&i_zpage,	0x84,	geninstr},
X	{ "styzx",	&i_zpage,	0x94,	geninstr},
X	{ "stya",	&i_abs,	0x8c,	geninstr},
X	{ "tax",	&i_nomem,	0xaa,	geninstr},
X	{ "tay",	&i_nomem,	0xa8,	geninstr},
X	{ "tsx",	&i_nomem,	0xba,	geninstr},
X	{ "txa",	&i_nomem,	0x8a,	geninstr},
X	{ "txs",	&i_nomem,	0x9a,	geninstr},
X	{ "tya",	&i_nomem,	0x98,	geninstr}
X};
X
X#define oplen sizeof(optab)/sizeof(opdef)
X
Xsymbol predef[] = {
X	{ "acptr",      0xffa5, &o_mem, (segmnt *) 0 },
X	{ "chkin",      0xffc6, &o_mem, (segmnt *) 0 },
X	{ "chkout",     0xffc9, &o_mem, (segmnt *) 0 },
X	{ "chrin",      0xffcf, &o_mem, (segmnt *) 0 },
X	{ "chrout",     0xffd2, &o_mem, (segmnt *) 0 },
X	{ "ciout",      0xffa8, &o_mem, (segmnt *) 0 },
X	{ "cint",       0xff81, &o_mem, (segmnt *) 0 },
X	{ "clall",      0xffe7, &o_mem, (segmnt *) 0 },
X	{ "close",      0xffc3, &o_mem, (segmnt *) 0 },
X	{ "clrchn",     0xffcc, &o_mem, (segmnt *) 0 },
X	{ "getin",      0xffe4, &o_mem, (segmnt *) 0 },
X	{ "iobase",     0xfff3, &o_mem, (segmnt *) 0 },
X	{ "ioinit",     0xff84, &o_mem, (segmnt *) 0 },
X	{ "listen",     0xffb1, &o_mem, (segmnt *) 0 },
X	{ "load",       0xffd5, &o_mem, (segmnt *) 0 },
X	{ "membot",     0xff9c, &o_mem, (segmnt *) 0 },
X	{ "memtop",     0xff99, &o_mem, (segmnt *) 0 },
X	{ "open",       0xffc0, &o_mem, (segmnt *) 0 },
X	{ "plot",       0xfff0, &o_mem, (segmnt *) 0 },
X	{ "ramtas",     0xff87, &o_mem, (segmnt *) 0 },
X	{ "rdtim",      0xffde, &o_mem, (segmnt *) 0 },
X	{ "readst",     0xffb7, &o_mem, (segmnt *) 0 },
X	{ "restor",     0xff8a, &o_mem, (segmnt *) 0 },
X	{ "save",       0xffd8, &o_mem, (segmnt *) 0 },
X	{ "scnkey",     0xff9f, &o_mem, (segmnt *) 0 },
X	{ "screen",     0xffed, &o_mem, (segmnt *) 0 },
X	{ "second",     0xff93, &o_mem, (segmnt *) 0 },
X	{ "setlfs",     0xffba, &o_mem, (segmnt *) 0 },
X	{ "setmsg",     0xff90, &o_mem, (segmnt *) 0 },
X	{ "setnam",     0xffbd, &o_mem, (segmnt *) 0 },
X	{ "settim",     0xffdb, &o_mem, (segmnt *) 0 },
X	{ "settmo",     0xffa2, &o_mem, (segmnt *) 0 },
X	{ "stop",       0xffe1, &o_mem, (segmnt *) 0 },
X	{ "talk",       0xffb4, &o_mem, (segmnt *) 0 },
X	{ "tksa",       0xff96, &o_mem, (segmnt *) 0 },
X	{ "udtim",      0xffea, &o_mem, (segmnt *) 0 },
X	{ "unlsn",      0xffae, &o_mem, (segmnt *) 0 },
X	{ "untlk",      0xffab, &o_mem, (segmnt *) 0 },
X	{ "vector",     0xff8d, &o_mem, (segmnt *) 0 },
X	{ "",           0x0,    &o_none, (segmnt *) 0 }
X};
/FUNKY/STUFF/
echo extracting - 6803_ops.h
sed 's/^X//' > 6803_ops.h << '/FUNKY/STUFF/'
X
Xopdclass o_reg   = { 1, NO , NO , NO , 0};
Xopdclass o_smem  = { 8, NO , NO , NO , 0};
Xopdclass o_rmem  = { 8, YES, NO , YES, -2};
Xopdclass o_mem   = {16, NO , NO , NO , 0};
Xopdclass o_off   = { 8, YES, NO , NO , 0};
Xopdclass o_data  = { 8, YES, NO , NO , 0};
Xopdclass o_data2 = {16, YES, NO , NO , 0};
Xopdclass o_cond  = { 4, NO , NO , NO , 0};
X
Xinsclass i_reg   = {1, 1, &o_reg , &o_none, -4, 0};
Xinsclass i_regp  = {1, 1, &o_reg , &o_none,  0, 0};
Xinsclass i_rimed = {2, 2, &o_reg , &o_data, -6, 8};
Xinsclass i_rimd2 = {3, 2, &o_reg , &o_data2,-6, 16};
Xinsclass i_rdir  = {2, 2, &o_reg , &o_smem, -6, 8};
Xinsclass i_rindx = {2, 2, &o_reg , &o_off , -6, 8};
Xinsclass i_rxtd  = {3, 2, &o_reg , &o_mem , -6,16};
Xinsclass i_imed  = {3, 1, &o_data2,&o_none, 16, 0};
Xinsclass i_dir   = {2, 1, &o_smem, &o_none,  8, 0};
Xinsclass i_indx  = {2, 1, &o_off , &o_none,  8, 0};
Xinsclass i_xtd   = {3, 1, &o_mem , &o_none, 16, 0};
Xinsclass i_rel   = {2, 1, &o_rmem, &o_none,  8, 0};
Xinsclass i_cond  = {2, 2, &o_cond, &o_rmem,  0, 8};
X
Xchoicedef c_adc = {"adcs" , "adcz" , 2, 0, 0xff, NO};
Xchoicedef c_add = {"adds" , "addz" , 2, 0, 0xff, NO};
Xchoicedef c_and = {"ands" , "andz" , 2, 0, 0xff, NO};
Xchoicedef c_bit = {"bits" , "bitz" , 2, 0, 0xff, NO};
Xchoicedef c_cmp = {"cmps" , "cmpz" , 2, 0, 0xff, NO};
Xchoicedef c_eor = {"eors" , "eorz" , 2, 0, 0xff, NO};
Xchoicedef c_lda = {"ldas" , "ldaz" , 2, 0, 0xff, NO};
Xchoicedef c_ldr = {"ldrs" , "ldrz" , 2, 0, 0xff, NO};
Xchoicedef c_ora = {"oras" , "oraz" , 2, 0, 0xff, NO};
Xchoicedef c_sbc = {"sbcs" , "sbcz" , 2, 0, 0xff, NO};
Xchoicedef c_sub = {"subs" , "subz" , 2, 0, 0xff, NO};
Xchoicedef c_dad = {"addds", "adddz", 1, 0, 0xff, NO};
Xchoicedef c_ldd = {"ldds" , "lddz" , 1, 0, 0xff, NO};
Xchoicedef c_std = {"stds" , "stdz" , 1, 0, 0xff, NO};
Xchoicedef c_sta = {"stas" , "staz" , 1, 0, 0xff, NO};
Xchoicedef c_str = {"strs" , "strz" , 1, 0, 0xff, NO};
Xchoicedef c_dsb = {"subds", "subdz", 1, 0, 0xff, NO};
Xchoicedef c_jsr = {"jsrs" , "jsrz" , 1, 0, 0xff, NO};
Xchoicedef c_cpx = {"cpxs" , "cpxz" , 1, 0, 0xff, NO};
X
Xopdef optab[] = {
X	"aba"    , &i_noopd, 0x1b, geninstr,
X	"abx"    , &i_noopd, 0x3a, geninstr,
X	"adc"    , (insclass *)&c_adc, 0x00, choiceinstr,
X	"adcs"   , &i_rdir , 0x99, geninstr,
X	"adci"   , &i_rimed, 0x89, geninstr,
X	"adcx"   , &i_rindx, 0xa9, geninstr,
X	"adcz"   , &i_rxtd , 0xb9, geninstr,
X	"add"    , (insclass *)&c_add, 0x00, choiceinstr,
X	"adds"   , &i_rdir , 0x9b, geninstr,
X	"addi"   , &i_rimed, 0x8b, geninstr,
X	"addd"   , (insclass *)&c_dad, 0x00, choiceinstr,
X	"addds"  , &i_dir  , 0xd3, geninstr,
X	"adddi"  , &i_imed , 0xc3, geninstr,
X	"adddx"  , &i_indx , 0xe3, geninstr,
X	"adddz"  , &i_xtd  , 0xf3, geninstr,
X	"addx"   , &i_rindx, 0xab, geninstr,
X	"addz"   , &i_rxtd , 0xbb, geninstr,
X	"and"    , (insclass *)&c_and, 0x00, choiceinstr,
X	"ands"   , &i_rdir , 0x94, geninstr,
X	"andi"   , &i_rimed, 0x84, geninstr,
X	"andx"   , &i_rindx, 0xa4, geninstr,
X	"andz"   , &i_rxtd , 0xb4, geninstr,
X	"asla"   , &i_reg  , 0x48, geninstr,
X	"asld"   , &i_noopd, 0x05, geninstr,
X	"aslx"   , &i_indx , 0x68, geninstr,
X	"asl"    , &i_xtd  , 0x78, geninstr,
X	"asra"   , &i_reg  , 0x47, geninstr,
X	"asrx"   , &i_indx , 0x67, geninstr,
X	"asr"    , &i_xtd  , 0x77, geninstr,
X	"bc"     , &i_cond , 0x20, geninstr,
X	"bit"    , (insclass *)&c_bit, 0x00, choiceinstr,
X	"bits"   , &i_rdir , 0x95, geninstr,
X	"biti"   , &i_rimed, 0x85, geninstr,
X	"bitx"   , &i_rindx, 0xa5, geninstr,
X	"bitz"   , &i_rxtd , 0xb5, geninstr,
X	"bra"    , &i_rel  , 0x20, geninstr,
X	"bsr"    , &i_rel  , 0x8d, geninstr,
X	"cba"    , &i_noopd, 0x11, geninstr,
X	"clc"    , &i_noopd, 0x0c, geninstr,
X	"cli"    , &i_noopd, 0x0e, geninstr,
X	"clra"   , &i_reg  , 0x4f, geninstr,
X	"clrx"   , &i_indx , 0x6f, geninstr,
X	"clr"    , &i_xtd  , 0x7f, geninstr,
X	"clv"    , &i_noopd, 0x0a, geninstr,
X	"cmp"    , (insclass *)&c_cmp, 0x00, choiceinstr,
X	"cmps"   , &i_rdir , 0x91, geninstr,
X	"cmpi"   , &i_rimed, 0x81, geninstr,
X	"cmpx"   , &i_rindx, 0xa1, geninstr,
X	"cmpz"   , &i_rxtd , 0xb1, geninstr,
X	"coma"   , &i_reg  , 0x43, geninstr,
X	"comx"   , &i_indx , 0x63, geninstr,
X	"com"    , &i_xtd  , 0x73, geninstr,
X	"cpx"    , (insclass *)&c_cpx, 0x00, choiceinstr,
X	"cpxs"   , &i_dir  , 0x9c, geninstr,
X	"cpxi"   , &i_imed , 0x8c, geninstr,
X	"cpxx"   , &i_indx , 0xac, geninstr,
X	"cpxz"   , &i_xtd  , 0xbc, geninstr,
X	"daa"    , &i_noopd, 0x19, geninstr,
X	"deca"   , &i_reg  , 0x4a, geninstr,
X	"decx"   , &i_indx , 0x6a, geninstr,
X	"dec"    , &i_xtd  , 0x7a, geninstr,
X	"des"    , &i_noopd, 0x34, geninstr,
X	"dex"    , &i_noopd, 0x09, geninstr,
X	"eor"    , (insclass *)&c_eor, 0x00, choiceinstr,
X	"eors"   , &i_rdir , 0x98, geninstr,
X	"eori"   , &i_rimed, 0x88, geninstr,
X	"eorx"   , &i_rindx, 0xa8, geninstr,
X	"eorz"   , &i_rxtd , 0xb8, geninstr,
X	"inca"   , &i_reg  , 0x4c, geninstr,
X	"incx"   , &i_indx , 0x6c, geninstr,
X	"inc"    , &i_xtd  , 0x7c, geninstr,
X	"ins"    , &i_noopd, 0x31, geninstr,
X	"inx"    , &i_noopd, 0x08, geninstr,
X	"jmpx"   , &i_indx , 0x6e, geninstr,
X	"jmp"    , &i_xtd  , 0x7e, geninstr,
X	"jsr"    , (insclass *)&c_jsr, 0x00, choiceinstr,
X	"jsrs"   , &i_dir  , 0x9d, geninstr,
X	"jsrx"   , &i_indx , 0xad, geninstr,
X	"jsrz"   , &i_xtd  , 0xbd, geninstr,
X	"lda"    , (insclass *)&c_lda, 0x00, choiceinstr,
X	"ldas"   , &i_rdir , 0x96, geninstr,
X	"ldai"   , &i_rimed, 0x86, geninstr,
X	"ldax"   , &i_rindx, 0xa6, geninstr,
X	"ldaz"   , &i_rxtd , 0xb6, geninstr,
X	"ldd"    , (insclass *)&c_ldd, 0x00, choiceinstr,
X	"ldds"   , &i_dir  , 0xdc, geninstr,
X	"lddi"   , &i_imed , 0xcc, geninstr,
X	"lddx"   , &i_indx , 0xec, geninstr,
X	"lddz"   , &i_xtd  , 0xfc, geninstr,
X	"ldr"    , (insclass *)&c_ldr, 0x00, choiceinstr,
X	"ldrs"   , &i_rdir , 0x9e, geninstr,
X	"ldri"   , &i_rimd2, 0x8e, geninstr,
X	"ldrx"   , &i_rindx, 0xae, geninstr,
X	"ldrz"   , &i_rxtd , 0xbe, geninstr,
X	"lsla"   , &i_reg  , 0x45, geninstr,
X	"lsld"   , &i_noopd, 0x05, geninstr,
X	"lslx"   , &i_indx , 0x65, geninstr,
X	"lsl"    , &i_xtd  , 0x75, geninstr,
X	"lsra"   , &i_reg  , 0x44, geninstr,
X	"lsrd"   , &i_noopd, 0x04, geninstr,
X	"lsrx"   , &i_indx , 0x64, geninstr,
X	"lsr"    , &i_xtd  , 0x74, geninstr,
X	"mul"    , &i_noopd, 0x3d, geninstr,
X	"nega"   , &i_reg  , 0x40, geninstr,
X	"negx"   , &i_indx , 0x60, geninstr,
X	"neg"    , &i_xtd  , 0x70, geninstr,
X	"nop"    , &i_noopd, 0x01, geninstr,
X	"ora"    , (insclass *)&c_ora, 0x00, choiceinstr,
X	"oras"   , &i_rdir , 0x9a, geninstr,
X	"orai"   , &i_rimed, 0x8a, geninstr,
X	"orax"   , &i_rindx, 0xaa, geninstr,
X	"oraz"   , &i_rxtd , 0xba, geninstr,
X	"psha"   , &i_regp , 0x36, geninstr,
X	"pshx"   , &i_noopd, 0x3c, geninstr,
X	"pula"   , &i_regp , 0x32, geninstr,
X	"pulx"   , &i_noopd, 0x38, geninstr,
X	"rola"   , &i_reg  , 0x49, geninstr,
X	"rolx"   , &i_indx , 0x69, geninstr,
X	"rol"    , &i_xtd  , 0x79, geninstr,
X	"rora"   , &i_reg  , 0x46, geninstr,
X	"rorx"   , &i_indx , 0x66, geninstr,
X	"ror"    , &i_xtd  , 0x76, geninstr,
X	"rti"    , &i_noopd, 0x3b, geninstr,
X	"rts"    , &i_noopd, 0x39, geninstr,
X	"sba"    , &i_noopd, 0x10, geninstr,
X	"sbc"    , (insclass *)&c_sbc, 0x00, choiceinstr,
X	"sbcs"   , &i_rdir , 0x92, geninstr,
X	"sbci"   , &i_rimed, 0x82, geninstr,
X	"sbcx"   , &i_rindx, 0xa2, geninstr,
X	"sbcz"   , &i_rxtd , 0xb2, geninstr,
X	"sec"    , &i_noopd, 0x0d, geninstr,
X	"sei"    , &i_noopd, 0x0f, geninstr,
X	"sev"    , &i_noopd, 0x0b, geninstr,
X	"sta"    , (insclass *)&c_sta, 0x00, choiceinstr,
X	"stas"   , &i_rdir , 0x97, geninstr,
X	"stax"   , &i_rindx, 0xa7, geninstr,
X	"staz"   , &i_rxtd , 0xb7, geninstr,
X	"std"    , (insclass *)&c_std, 0x00, choiceinstr,
X	"stds"   , &i_dir  , 0xdd, geninstr,
X	"stdx"   , &i_indx , 0xed, geninstr,
X	"stdz"   , &i_xtd  , 0xfd, geninstr,
X	"str"    , (insclass *)&c_str, 0x00, choiceinstr,
X	"strs"   , &i_rdir , 0x9f, geninstr,
X	"strx"   , &i_rindx, 0xaf, geninstr,
X	"strz"   , &i_rdir , 0xbf, geninstr,
X	"sub"    , (insclass *)&c_sub, 0x00, choiceinstr,
X	"subs"   , &i_rdir , 0x90, geninstr,
X	"subi"   , &i_rimed, 0x80, geninstr,
X	"subd"   , (insclass *)&c_dsb, 0x00, choiceinstr,
X	"subds"  , &i_dir  , 0x93, geninstr,
X	"subdi"  , &i_imed , 0x83, geninstr,
X	"subdx"  , &i_indx , 0xa3, geninstr,
X	"subdz"  , &i_xtd  , 0xb3, geninstr,
X	"subx"   , &i_rindx, 0xa0, geninstr,
X	"subz"   , &i_rxtd , 0xb0, geninstr,
X	"swi"    , &i_noopd, 0x3f, geninstr,
X	"tab"    , &i_noopd, 0x16, geninstr,
X	"tap"    , &i_noopd, 0x06, geninstr,
X	"tba"    , &i_noopd, 0x17, geninstr,
X	"tpa"    , &i_noopd, 0x07, geninstr,
X	"tsta"   , &i_reg  , 0x4d, geninstr,
X	"tstx"   , &i_indx , 0x6d, geninstr,
X	"tst"    , &i_xtd  , 0x7d, geninstr,
X	"tsx"    , &i_noopd, 0x30, geninstr,
X	"txs"    , &i_noopd, 0x35, geninstr,
X	"wai"    , &i_noopd, 0x3e, geninstr,
X};
X
X#define oplen sizeof(optab)/sizeof(opdef)
X
Xsymbol predef[] = {
X	{"ra" , 0x0, &o_reg , (segmnt *)0 },
X	{"rb" , 0x1, &o_reg , (segmnt *)0 },
X	{"rx" , 0x1, &o_reg , (segmnt *)0 },
X	{"sp" , 0x0, &o_reg , (segmnt *)0 },
X	{"nz" , 0x6, &o_cond, (segmnt *)0 },
X	{"z"  , 0x7, &o_cond, (segmnt *)0 },
X	{"ne" , 0x6, &o_cond, (segmnt *)0 },
X	{"eq" , 0x7, &o_cond, (segmnt *)0 },
X	{"nc" , 0x4, &o_cond, (segmnt *)0 },
X	{"c"  , 0x5, &o_cond, (segmnt *)0 },
X	{"gez", 0xc, &o_cond, (segmnt *)0 },
X	{"gz" , 0xe, &o_cond, (segmnt *)0 },
X	{"gt" , 0x2, &o_cond, (segmnt *)0 },
X	{"lez", 0xf, &o_cond, (segmnt *)0 },
X	{"le" , 0x3, &o_cond, (segmnt *)0 },
X	{"lz" , 0xd, &o_cond, (segmnt *)0 },
X	{"m"  , 0xb, &o_cond, (segmnt *)0 },
X	{"ov" , 0x9, &o_cond, (segmnt *)0 },
X	{"nov", 0x8, &o_cond, (segmnt *)0 },
X	{"p"  , 0xa, &o_cond, (segmnt *)0 },
X	{"ge" , 0x4, &o_cond, (segmnt *)0 },
X	{"lt" , 0x5, &o_cond, (segmnt *)0 },
X	{""   , 0x0, &o_none, (segmnt *)0 },
X};
/FUNKY/STUFF/
echo extracting - 8085_ops.h
sed 's/^X//' > 8085_ops.h << '/FUNKY/STUFF/'
Xopdclass o_reg   = { 3, NO , NO , NO , 0};
Xopdclass o_rp    = { 2, NO , NO , NO , 0};
Xopdclass o_mem   = {16, NO , YES, NO , 0};
Xopdclass o_data  = { 8, YES, NO , NO , 0};
Xopdclass o_data2 = {16, YES, YES, NO , 0};
Xopdclass o_port  = { 8, NO , NO , NO , 0};
Xopdclass o_rupt  = { 3, NO , NO , NO , 0};
Xopdclass o_cond  = { 3, NO , NO , NO , 0};
X
Xinsclass i_reg1  = {1, 1, &o_reg , &o_none, -3, 0};
Xinsclass i_reg2  = {1, 1, &o_reg , &o_none,  0, 0};
Xinsclass i_rp    = {1, 1, &o_rp  , &o_none, -4, 0};
Xinsclass i_data  = {2, 1, &o_data, &o_none,  8, 0};
Xinsclass i_rd    = {2, 2, &o_reg , &o_data, -3, 8};
Xinsclass i_drd   = {3, 2, &o_reg , &o_data2,-3, 16};
Xinsclass i_mem   = {3, 1, &o_mem , &o_none,  8, 0};
Xinsclass i_rupt  = {1, 1, &o_rupt, &o_none, -3, 0};
Xinsclass i_port  = {2, 1, &o_port, &o_none,  8, 0};
Xinsclass i_rr    = {1, 2, &o_reg , &o_reg , -3, 0};
Xinsclass i_cond  = {1, 1, &o_cond, &o_none, -3, 0};
Xinsclass i_condm = {3, 2, &o_cond, &o_mem , -3, 16};
X
Xopdef optab[] = {
X	"aci"    , &i_data , 0xce, geninstr,
X	"adc"    , &i_reg2 , 0x88, geninstr,
X	"adcm"   , &i_noopd, 0x8e, geninstr,
X	"add"    , &i_reg2 , 0x80, geninstr,
X	"addm"   , &i_noopd, 0x86, geninstr,
X	"adi"    , &i_data , 0xc6, geninstr,
X	"ana"    , &i_reg2 , 0xa0, geninstr,
X	"anam"   , &i_noopd, 0xa6, geninstr,
X	"ani"    , &i_data , 0xe6, geninstr,
X	"call"   , &i_mem  , 0xcd, geninstr,
X	"cc"     , &i_condm, 0xc4, geninstr,
X	"cma"    , &i_noopd, 0x2f, geninstr,
X	"cmc"    , &i_noopd, 0x3f, geninstr,
X	"cmp"    , &i_reg2 , 0xb8, geninstr,
X	"cmpm"   , &i_noopd, 0xbe, geninstr,
X	"cpi"    , &i_data , 0xfe, geninstr,
X	"daa"    , &i_noopd, 0x27, geninstr,
X	"dad"    , &i_rp   , 0x09, geninstr,
X	"dcr"    , &i_reg1 , 0x05, geninstr,
X	"dcrm"   , &i_noopd, 0x35, geninstr,
X	"dcx"    , &i_rp   , 0x0b, geninstr,
X	"di"     , &i_noopd, 0xf3, geninstr,
X	"ei"     , &i_noopd, 0xfd, geninstr,
X	"hlt"    , &i_noopd, 0x76, geninstr,
X	"in"     , &i_port , 0xdb, geninstr,
X	"inr"    , &i_reg1 , 0x04, geninstr,
X	"inrm"   , &i_noopd, 0x34, geninstr,
X	"inx"    , &i_rp   , 0x03, geninstr,
X	"jc"     , &i_condm, 0xc2, geninstr,
X	"jmp"    , &i_mem  , 0xc3, geninstr,
X	"lda"    , &i_mem  , 0x3a, geninstr,
X	"ldax"   , &i_rp   , 0x0a, geninstr,
X	"ldi"    , &i_rd   , 0x06, geninstr,
X	"ldr"    , &i_reg1 , 0x46, geninstr,
X	"lhld"   , &i_mem  , 0x2a, geninstr,
X	"lxi"    , &i_drd  , 0x01, geninstr,
X	"mrr"    , &i_rr   , 0x40, geninstr,
X	"mvim"   , &i_data , 0x36, geninstr,
X	"nop"    , &i_noopd, 0x00, geninstr,
X	"ora"    , &i_reg2 , 0xb0, geninstr,
X	"oram"   , &i_noopd, 0xb6, geninstr,
X	"ori"    , &i_data , 0xf6, geninstr,
X	"out"    , &i_port , 0xd3, geninstr,
X	"pchl"   , &i_noopd, 0xe9, geninstr,
X	"pop"    , &i_rp   , 0xc1, geninstr,
X	"poppsw" , &i_noopd, 0xf1, geninstr,
X	"push"   , &i_rp   , 0xc5, geninstr,
X	"pushpsw", &i_noopd, 0xf5, geninstr,
X	"ral"    , &i_noopd, 0x17, geninstr,
X	"rar"    , &i_noopd, 0x1f, geninstr,
X	"rc"     , &i_condm, 0xc0, geninstr,
X	"ret"    , &i_noopd, 0xc9, geninstr,
X	"rim"    , &i_noopd, 0x20, geninstr,
X	"rlc"    , &i_noopd, 0x07, geninstr,
X	"rrc"    , &i_noopd, 0x0f, geninstr,
X	"rst"    , &i_rupt , 0xc7, geninstr,
X	"sbb"    , &i_reg2 , 0x98, geninstr,
X	"sbbm"   , &i_noopd, 0x9e, geninstr,
X	"sbi"    , &i_data , 0xde, geninstr,
X	"shld"   , &i_mem  , 0x22, geninstr,
X	"sim"    , &i_noopd, 0x30, geninstr,
X	"sphl"   , &i_noopd, 0xf9, geninstr,
X	"sta"    , &i_mem  , 0x32, geninstr,
X	"stax"   , &i_rp   , 0x02, geninstr,
X	"stc"    , &i_noopd, 0x37, geninstr,
X	"str"    , &i_reg2 , 0x70, geninstr,
X	"sub"    , &i_reg2 , 0x90, geninstr,
X	"subm"   , &i_noopd, 0x96, geninstr,
X	"sui"    , &i_data , 0xd6, geninstr,
X	"xchg"   , &i_noopd, 0xeb, geninstr,
X	"xra"    , &i_reg2 , 0xa8, geninstr,
X	"xram"   , &i_noopd, 0xae, geninstr,
X	"xri"    , &i_data , 0xee, geninstr,
X	"xthl"   , &i_noopd, 0xe3, geninstr,
X};
X
X#define oplen sizeof(optab)/sizeof(opdef)
X
Xsymbol predef[] = {
X	{"ra"        ,      7, &o_reg , (segmnt *)0 },
X	{"rb"        ,      0, &o_reg , (segmnt *)0 },
X	{"rc"        ,      1, &o_reg , (segmnt *)0 },
X	{"rd"        ,      2, &o_reg , (segmnt *)0 },
X	{"re"        ,      3, &o_reg , (segmnt *)0 },
X	{"rh"        ,      4, &o_reg , (segmnt *)0 },
X	{"rl"        ,      5, &o_reg , (segmnt *)0 },
X	{"rbc"       ,      0, &o_rp  , (segmnt *)0 },
X	{"rde"       ,      1, &o_rp  , (segmnt *)0 },
X	{"rhl"       ,      2, &o_rp  , (segmnt *)0 },
X	{"sp"        ,      3, &o_rp  , (segmnt *)0 },
X	{"rupt0"     ,      0, &o_rupt, (segmnt *)0 },
X	{"rupt1"     ,      1, &o_rupt, (segmnt *)0 },
X	{"rupt2"     ,      2, &o_rupt, (segmnt *)0 },
X	{"rupt3"     ,      3, &o_rupt, (segmnt *)0 },
X	{"rupt4"     ,      4, &o_rupt, (segmnt *)0 },
X	{"rupt5"     ,      5, &o_rupt, (segmnt *)0 },
X	{"rupt6"     ,      6, &o_rupt, (segmnt *)0 },
X	{"rupt7"     ,      7, &o_rupt, (segmnt *)0 },
X	{"nz"        ,      0, &o_cond, (segmnt *)0 },
X	{"z"         ,      1, &o_cond, (segmnt *)0 },
X	{"nc"        ,      2, &o_cond, (segmnt *)0 },
X	{"c"         ,      3, &o_cond, (segmnt *)0 },
X	{"po"        ,      4, &o_cond, (segmnt *)0 },
X	{"pe"        ,      5, &o_cond, (segmnt *)0 },
X	{"p"         ,      6, &o_cond, (segmnt *)0 },
X	{"m"         ,      7, &o_cond, (segmnt *)0 },
X	{"ramstart"  ,      0, &o_mem , (segmnt *)0 },
X	{"ramend"    ,      0, &o_mem , (segmnt *)0 },
X	{"romstart"  ,      0, &o_mem , (segmnt *)0 },
X	{"romend"    ,      0, &o_mem , (segmnt *)0 },
X	{""          ,      0, &o_none, (segmnt *)0 }
X};
/FUNKY/STUFF/