       
endcode  

* Variables
brkinst  dfb 0            ;Old break instruction
brkaddr  dfb 0,0,0        ;address

repflag  dfb 0            ;REP/SEP flag

keyw     txt ':;rmgxls'
         txt 'tfhd_p,ae^bziwn\#@?',00

kaddr    dw altm-super-1
         dw altr-super-1
         dw dsplyr-super-1
         dw dsplym-super-1
         dw go-super-1
         dw exit-super-1
         dw load-super-1
         dw save-super-1
         dw trans-super-1
         dw fill-super-1
         dw hunt-super-1
         dw disas-super-1
         dw backdis-super-1
         dw prin-super-1
         dw redis-super-1
         dw assemble-super-1
         dw dispr2-super-1
         dw altr2-super-1
         dw setbrk-super-1
         dw singstep-super-1
         dw dsplyt-super-1
         dw whereami-super-1
         dw relocate-super-1
         dw repsep-super-1
         dw convnum-super-1
         dw diskcmd-super-1
         dw help-super-1
regk     dfb $0d
         txt ' pbr  pc '
         txt '  ac   xr   yr   sp '
         txt ' vnmxdizce'
         dfb 00
regk2    dfb 13
         txt ' dbr  dp  01',00

endchar  txt ',)]'
         dfb $0d          ;return!

leadchar txt '$!><([#'
         dfb 13
leadadr  
         da abs-super-1   ;Absolute
         da abs8-super-1  ;Absolute ZP
         da abs16-super-1 ;Absolute 16-bit
         da abs24-super-1 ;Absolute long
         da indir-super-1 ;Indirect
         da lindir-super-1 ;Long indirect
         da immed-super-1 ;Immediate
         da accum-super-1 ;Accumulator

times3p3 dfb 3,6,9,12,15  ;x*3+3

                          ;opcode mnemonic table index
nemtab   dfb 11,20,80,2,49,2,80,2    ;$0x
         dfb 9,41,79,2,15,27,79,2    ;$1x
         dfb 33,32,6,59,55,59,6,59   ;$2x
         dfb 7,1,6,59,65,23,6,59     ;$3x
         dfb 61,89,39,37,45,37,31,37 ;$4x
         dfb 13,26,38,37,17,51,31,37 ;$5x
         dfb 63,44,73,60,52,60,31,60 ;$6x
         dfb 14,0,73,60,67,57,31,60  ;$7x
         dfb 10,12,72,71,25,83,72,71 ;$8x
         dfb 3,69,72,71,86,84,73,73  ;$9x
         dfb 36,35,36,35,75,74,36,35 ;$ax
         dfb 4,34,36,35,18,82,36,35  ;$bx
         dfb 22,58,22,23,29,24,22,23 ;$cx
         dfb 8,19,43,23,16,50,30,23  ;$dx
         dfb 21,68,21,27,28,40,21,27 ;$ex
         dfb 5,64,42,27,66,56,33,27  ;$fx

         dfb 47,77,54,81,48,76,62,78 ;last row = $xb / 16
         dfb 46,85,53,87,88,70,90,91

                          ;even opcodes: ORA AND EOR ADC
                          ;              STA LDA CMP SBC
nemtab2  dfb 41,1,26,0,69,34,19,64

                          ; opcode mode table for above
                          ; 0= A/i/s  6= d    b= a,y   10= (d),y
                          ; 1= #      7= d,x  c= al    11= (a,x)
                          ; 2= d,d    8= d,y  d= al,x  12= (d,x)
                          ; 3= rel    9= a    e= (a)   13= (d,s),y
                          ; 4= rlong  a= a,x  f= (d)   14= [d]
                          ; 5= d,s                     15= [d],y
modetab  dfb 0,0,6,6,0,0,9,9
         hex 030f06070000090a ;$1x
         hex 090c060600000909 ;$2x
         hex 030f070700000a0a ;$3x
         hex 0006020600000909 ;$4x
         hex 030f020700000c0a ;$5x
         hex 0004060600000e09 ;$6x
         hex 030f07070000110a ;$7x
         hex 0304060600000909 ;$8x
         hex 030f07080000090a ;$9x
         hex 0101060600000909 ;$ax
         hex 030f070800000a0b ;$bx
         hex 0101060600000909 ;$cx
         hex 030f0f0700000e0a ;$dx
         hex 0101060600000909 ;$ex
         hex 030f09070000110a ;$fx

modetab2 hex 1205061401ff090c ;odd opcodes
         hex 101307150bff0a0d ;most sig. 5 bits

                          ; Address mode lengths
modelen  dfb 0,1,2,1,2,1
         dfb 1,1,1,2,2
         dfb 2,3,3,2,1
         dfb 1,2,1,1,1,1
                          ; packed mnemonics
mneml    
mnemr    = mneml+92

endvars  = mnemr+92
