+do_fetch_0:
+ ldi opl,0
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|IN r,[C] |***P0-|Input |r=[C] |
+;
+
+do_op_in: ; in opl,(opl)
+.if PORT_DEBUG
+ push opl
+ cp opl,_0 ; don't debug port 0 (con stat)
+ breq dbg_op_in_1
+ printnewline
+ printstring "Port read: ("
+ mov temp,opl
+ lcall printhex
+ printstring ") -> "
+dbg_op_in_1:
+.endif
+
+ mov temp2,opl
+ lcall portRead
+ mov opl,temp
+ bst z_flags,ZFL_C ;save Carry
+ ldpmx z_flags,sz53p_tab,temp ;S,Z,P
+ bld z_flags,ZFL_C
+
+.if PORT_DEBUG
+ pop temp
+ cp temp,_0
+ breq dbg_op_in_2
+ lcall printhex
+ printstring " "
+dbg_op_in_2:
+.endif
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|OUT [C],r |------|Output |[C]=r |
+;
+
+do_op_out: ; out (c),opl
+.if PORT_DEBUG
+ printnewline
+ printstring "Port write: "
+ mov temp,opl
+ lcall printhex
+ printstring " -> ("
+ mov temp,z_c
+ lcall printhex
+ printstring ") "
+.endif
+ mov temp,opl
+ mov temp2,z_c
+ lcall portWrite
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|LD dst,src|------|Load |dst=src |
+;
+
+do_op_stbc: ;store bc to mem loc in opl:h
+ movw xl,opl
+ mem_write_s z_c
+ adiw xl,1
+ mem_write_s z_b
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|LD dst,src|------|Load |dst=src |
+;
+;
+do_op_stde: ;store de to mem loc in opl:h
+ movw xl,opl
+ mem_write_s z_e
+ adiw xl,1
+ mem_write_s z_d
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|LD dst,src|------|Load |dst=src |
+;
+;
+do_op_stsp: ;store sp to mem loc in opl:h
+ movw xl,opl
+ mem_write_s z_spl
+ adiw xl,1
+ mem_write_s z_sph
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|ADC HL,ss |***V0*|Add with Carry |HL=HL+ss+CY |
+;
+
+do_op_ADCHL:
+ lsr z_flags ; ZFL_C --> Carry
+ ldi z_flags,0 ; clear N
+ adc z_l,opl
+ in temp,sreg ; save lower Z
+ adc z_h,oph
+ in temp2,sreg
+
+ and temp,temp2 ; 16bit Z
+ bmov z_flags,ZFL_C, temp2,AVR_C
+ bmov z_flags,ZFL_P, temp2,AVR_V
+ bmov z_flags,ZFL_H, temp2,AVR_H
+ bmov z_flags,ZFL_Z, temp,AVR_Z
+ bmov z_flags,ZFL_S, temp2,AVR_N
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|SBC HL,ss |***V1*|Subtract with carry |HL=HL-ss-CY |
+;
+
+ checkspace PC, 24
+
+do_op_sbchl:
+ lsr z_flags ; get Z80 carry
+ sez ; set z
+ sbc z_l,opl
+ sbc z_h,oph
+ in temp,sreg
+ ldi z_flags,(1<<ZFL_N) ; set N
+ bmov z_flags,ZFL_C, temp,AVR_C
+ bmov z_flags,ZFL_P, temp,AVR_V
+ bmov z_flags,ZFL_H, temp,AVR_H
+ bmov z_flags,ZFL_Z, temp,AVR_Z
+ bmov z_flags,ZFL_S, temp,AVR_N
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|NEG |***V1*|Negate A |A=0-A |
+
+;
+do_op_NEG:
+ ldi temp,0
+ sub temp,z_a
+ mov z_a,temp
+ in temp,sreg
+ ldpmx z_flags,sz53p_tab,z_a ;S,Z,P
+ bmov z_flags,ZFL_C, temp,AVR_C
+ bmov z_flags,ZFL_H, temp,AVR_H
+ do_z80_flags_V
+ do_z80_flags_set_N
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|RETI |------|Return from Interrupt|PC=[SP]+ |
+;|RETN |------|Return from NMI | Copy IFF2 to IFF1 |
+
+
+do_op_RETI:
+do_op_RETN:
+ ldd temp,y+oz_istat
+ bmov temp,IFF1, temp,IFF2
+ std y+oz_istat,temp
+ ljmp do_store_ret
+
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|IM n |------|Interrupt Mode | (n=0,1,2)|
+
+do_op_IM0:
+ ldd temp,y+oz_istat
+ andi temp, ~IM_MASK
+ std y+oz_istat,temp
+ ret
+
+do_op_IM1:
+ ldd temp,y+oz_istat
+ andi temp,~IM_MASK
+ ori temp,IM1
+ std y+oz_istat,temp
+ ret
+
+do_op_IM2:
+ ldd temp,y+oz_istat
+ andi temp, ~IM_MASK
+ ori temp,IM2
+ std y+oz_istat,temp
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|LD A,i |**0*0-|Load |(i=I,R) IFF2 --> P |
+;|LD i,A |------|Load |(i=I,R) |
+
+do_op_ldai:
+ ldd z_a,y+oz_i
+ rjmp op_ldar1
+
+do_op_ldar:
+ ldd z_a,y+oz_r
+op_ldar1:
+ bst z_flags,ZFL_C ;save C
+ ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N
+ bld z_flags,ZFL_C ;
+ ldd temp,y+oz_istat
+ bmov z_flags,ZFL_P, temp,IFF2
+ ret
+
+do_op_ldia:
+ std y+oz_i,z_a
+ ret
+
+do_op_ldra:
+ std y+oz_r,z_a
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|RLD |**0P0-|Rotate Left 4 bits |{A,[HL]}={A,[HL]}<- ##|
+;|RRD |**0P0-|Rotate Right 4 bits |{A,[HL]}=->{A,[HL]} ##|
+
+do_op_rld:
+ swap opl
+ mov oph,opl
+ andi opl,0xf0
+ andi oph,0x0f
+ mov temp,z_a
+ andi temp,0x0f
+ or opl,temp
+ mov temp,z_a
+ andi temp,0xf0
+ or temp,oph
+ mov z_a,temp
+ bst z_flags,ZFL_C ;save C
+ ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N
+ bld z_flags,ZFL_C ;
+ ret
+
+do_op_rrd:
+ mov oph,opl
+ andi opl,0xf0
+ andi oph,0x0f
+ mov temp,z_a
+ andi temp,0x0f
+ or opl,temp
+ swap opl
+ mov temp,z_a
+ andi temp,0xf0
+ or temp,oph
+ mov z_a,temp
+ bst z_flags,ZFL_C ;save C
+ ldpmx z_flags,sz53p_tab,z_a ;S,Z,H,P,N
+ bld z_flags,ZFL_C ;
+ ret
+
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|LDD |--0*0-|Load and Decrement |[DE]=[HL],HL=HL-1,# |
+;|LDDR |--000-|Load, Dec., Repeat |LDD till BC=0 |
+;|LDI |--0*0-|Load and Increment |[DE]=[HL],HL=HL+1,# |
+;|LDIR |--000-|Load, Inc., Repeat |LDI till BC=0 |
+;
+
+ checkspace PC, 13
+
+op_LDxx_common:
+ movw x,z_l ;HL
+; mem_read_ds temp, z
+ lcall dram_read ; temp = (HL)
+ movw x,z_e ;DE
+; mem_write_ds x, temp
+ lcall dram_write ; (DE) = temp
+
+ cbr z_flags,(1<<ZFL_H) | (1<<ZFL_P) | (1<<ZFL_N)
+
+ movw x,z_c
+ sbiw x,1 ;BC--
+ movw z_c,x
+ breq PC+2
+ sbr z_flags,(1<<ZFL_P)
+ ret
+
+ checkspace PC, 6
+
+do_op_LDI:
+ rcall op_LDxx_common
+ sub z_e,_255 ;-low(-1) DE++
+ sbc z_d,_255 ;-high(-1)
+ sub z_l,_255 ;-low(-1) HL++
+ sbc z_h,_255 ;-high(-1)
+ ret
+
+ checkspace PC, 6
+
+do_op_LDD:
+ rcall op_LDxx_common
+ add z_e,_255 ;+low(-1) DE--
+ adc z_d,_255 ;+high(-1)
+ add z_l,_255 ;+low(-1) HL--
+ adc z_h,_255 ;+high(-1)
+ ret
+
+ checkspace PC, 5
+
+do_op_LDIR:
+ rcall do_op_LDI
+#if 1
+ sbrc z_flags,ZFL_P
+ rjmp do_op_LDIR
+ ret
+#else
+ sbrs z_flags,ZFL_P
+ ret
+ sbiw z_pcl,2
+ ret
+#endif
+
+ checkspace PC, 5
+
+do_op_LDDR:
+ rcall do_op_LDD
+ sbrs z_flags,ZFL_P
+ ret
+ sbiw z_pcl,2
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|CPD |****1-|Compare and Decrement|A-[HL],HL=HL-1,BC=BC-1|
+;|CPDR |****1-|Compare, Dec., Repeat|CPD till A=[HL]or BC=0|
+;|CPI |****1-|Compare and Increment|A-[HL],HL=HL+1,BC=BC-1|
+;|CPIR |****1-|Compare, Inc., Repeat|CPI till A=[HL]or BC=0|
+
+
+ checkspace PC, 21
+
+op_CPxx_common:
+ movw x,z_l ; HL
+
+ movw z,z_c ;BC
+
+ cbr z_flags,(1<<ZFL_S)|(1<<ZFL_Z)|(1<<ZFL_H)|(1<<ZFL_P)
+ sbr z_flags,(1<<ZFL_N)
+ lcall dram_read ; temp = (HL)
+
+ cp z_a,temp ; A - (HL)
+
+ brpl PC+2
+ sbr z_flags,(1<<ZFL_S)
+ brne PC+2
+ sbr z_flags,(1<<ZFL_Z)
+ brhc PC+2
+ sbr z_flags,(1<<ZFL_H)
+
+ sbiw z,1 ; BC--
+ breq PC+2
+ sbr z_flags,(1<<ZFL_P)
+ movw z_c,z ;BC
+ ret
+
+ checkspace PC, 5
+
+do_op_CPI:
+ rcall op_CPxx_common
+ adiw x,1 ; HL++
+ movw z_l,x ; HL
+ ret
+
+
+ checkspace PC, 5
+
+do_op_CPD:
+ rcall op_CPxx_common
+ sbiw x,1 ; HL--
+ movw z_l,x ; HL
+ ret
+
+ checkspace PC, 7
+
+do_op_CPIR:
+ rcall do_op_CPI
+ sbrc z_flags,ZFL_Z
+ ret
+ sbrs z_flags,ZFL_P
+ ret
+ sbiw z_pcl,2
+ ret
+
+ checkspace PC, 7
+
+do_op_CPDR:
+ rcall do_op_CPD
+ sbrc z_flags,ZFL_Z
+ ret
+ sbrs z_flags,ZFL_P
+ ret
+ sbiw z_pcl,2
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|INI |?*??1-|Input and Increment |[HL]=[C],HL=HL+1,B=B-1|
+;|IND |?*??1-|Input and Decrement |[HL]=[C],HL=HL-1,B=B-1|
+;|INIR |?1??1-|Input, Inc., Repeat |INI till B=0 |
+;|INDR |?1??1-|Input, Dec., Repeat |IND till B=0 |
+
+ checkspace PC, 12
+
+op_INxx_common:
+ cbr z_flags,(1<<ZFL_Z)
+ sbr z_flags,(1<<ZFL_N)
+ mov temp2,z_c ;C
+ lcall portRead
+ movw x,z_l ;HL
+ lcall dram_write
+ dec z_b ;B
+ brne PC+2
+ sbr z_flags,(1<<ZFL_Z)
+ ret
+
+ checkspace PC, 4
+
+do_op_INI:
+ rcall op_INxx_common
+ adiw x,1
+ movw z_l,x ;HL
+ ret
+
+ checkspace PC, 4
+
+do_op_IND:
+ rcall op_INxx_common
+ sbiw x,1
+ movw z_l,x ;HL
+ ret
+
+ checkspace PC, 5
+
+do_op_INIR:
+ rcall do_op_INI
+ sbrc z_flags,ZFL_Z
+ ret
+ sbiw z_pcl,2
+ ret
+
+ checkspace PC, 5
+
+do_op_INDR:
+ rcall do_op_IND
+ sbrc z_flags,ZFL_Z
+ ret
+ sbiw z_pcl,2
+ ret
+
+;----------------------------------------------------------------
+;|Mnemonic |SZHPNC|Description |Notes |
+;----------------------------------------------------------------
+;|OUTI |?*??1-|Output and Increment |[C]=[HL],HL=HL+1,B=B-1|
+;|OUTD |?*??1-|Output and Decrement |[C]=[HL],HL=HL-1,B=B-1|
+;|OTIR |?1??1-|Output, Inc., Repeat |OUTI till B=0 |
+;|OTDR |?1??1-|Output, Dec., Repeat |OUTD till B=0 |
+
+ checkspace PC, 12
+
+op_OUTxx_common:
+ movw x,z_l ;HL
+ lcall dram_read ;temp = (z)
+ mov temp2,z_c ;C
+ lcall portWrite
+ cbr z_flags,(1<<ZFL_Z)
+ sbr z_flags,(1<<ZFL_N)
+ dec z_b ;B
+ brne PC+2
+ sbr z_flags,(1<<ZFL_Z)
+ ret
+
+ checkspace PC, 4
+
+do_op_OUTI:
+ rcall op_OUTxx_common
+ sub z_l,_255 ;-low(-1)
+ sbc z_h,_255 ;-high(-1)
+ ret
+
+ checkspace PC, 4
+
+do_op_OUTD:
+ rcall op_OUTxx_common
+ add z_l,_255 ;+low(-1)
+ adc z_h,_255 ;+high(-1)
+ ret
+
+ checkspace PC, 5
+
+do_op_OTIR:
+ rcall do_op_OUTI
+ sbrc z_flags,ZFL_Z
+ ret
+ sbiw z_pcl,2
+ ret
+
+ checkspace PC, 5
+
+do_op_OTDR:
+ rcall do_op_OUTD
+ sbrc z_flags,ZFL_Z
+ ret
+ sbiw z_pcl,2
+ ret
+
+#if 1
+ opctable EDjmp, PC ;+ 2*256
+
+instr fetch_nop, op_nop, store_nop ;00 ;NOP
+instr fetch_nop, op_nop, store_nop ;01 ;NOP
+instr fetch_nop, op_nop, store_nop ;02 ;NOP
+instr fetch_nop, op_nop, store_nop ;03 ;NOP
+instr fetch_nop, op_nop, store_nop ;04 ;NOP
+instr fetch_nop, op_nop, store_nop ;05 ;NOP
+instr fetch_nop, op_nop, store_nop ;06 ;NOP
+instr fetch_nop, op_nop, store_nop ;07 ;NOP
+instr fetch_nop, op_nop, store_nop ;08 ;NOP
+instr fetch_nop, op_nop, store_nop ;09 ;NOP
+instr fetch_nop, op_nop, store_nop ;0A ;NOP
+instr fetch_nop, op_nop, store_nop ;0B ;NOP
+instr fetch_nop, op_nop, store_nop ;0C ;NOP
+instr fetch_nop, op_nop, store_nop ;0D ;NOP
+instr fetch_nop, op_nop, store_nop ;0E ;NOP
+instr fetch_nop, op_nop, store_nop ;0F ;NOP
+instr fetch_nop, op_nop, store_nop ;10 ;NOP
+instr fetch_nop, op_nop, store_nop ;11 ;NOP
+instr fetch_nop, op_nop, store_nop ;12 ;NOP
+instr fetch_nop, op_nop, store_nop ;13 ;NOP
+instr fetch_nop, op_nop, store_nop ;14 ;NOP
+instr fetch_nop, op_nop, store_nop ;15 ;NOP
+instr fetch_nop, op_nop, store_nop ;16 ;NOP
+instr fetch_nop, op_nop, store_nop ;17 ;NOP
+instr fetch_nop, op_nop, store_nop ;18 ;NOP
+instr fetch_nop, op_nop, store_nop ;19 ;NOP
+instr fetch_nop, op_nop, store_nop ;1A ;NOP
+instr fetch_nop, op_nop, store_nop ;1B ;NOP
+instr fetch_nop, op_nop, store_nop ;1C ;NOP
+instr fetch_nop, op_nop, store_nop ;1D ;NOP
+instr fetch_nop, op_nop, store_nop ;1E ;NOP
+instr fetch_nop, op_nop, store_nop ;1F ;NOP
+instr fetch_nop, op_nop, store_nop ;20 ;NOP
+instr fetch_nop, op_nop, store_nop ;21 ;NOP
+instr fetch_nop, op_nop, store_nop ;22 ;NOP
+instr fetch_nop, op_nop, store_nop ;23 ;NOP
+instr fetch_nop, op_nop, store_nop ;24 ;NOP
+instr fetch_nop, op_nop, store_nop ;25 ;NOP
+instr fetch_nop, op_nop, store_nop ;26 ;NOP
+instr fetch_nop, op_nop, store_nop ;27 ;NOP
+instr fetch_nop, op_nop, store_nop ;28 ;NOP
+instr fetch_nop, op_nop, store_nop ;29 ;NOP
+instr fetch_nop, op_nop, store_nop ;2A ;NOP
+instr fetch_nop, op_nop, store_nop ;2B ;NOP
+instr fetch_nop, op_nop, store_nop ;2C ;NOP
+instr fetch_nop, op_nop, store_nop ;2D ;NOP
+instr fetch_nop, op_nop, store_nop ;2E ;NOP
+instr fetch_nop, op_nop, store_nop ;2F ;NOP
+instr fetch_nop, op_nop, store_nop ;30 ;NOP
+instr fetch_nop, op_nop, store_nop ;31 ;NOP
+instr fetch_nop, op_nop, store_nop ;32 ;NOP
+instr fetch_nop, op_nop, store_nop ;33 ;NOP
+instr fetch_nop, op_nop, store_nop ;34 ;NOP
+instr fetch_nop, op_nop, store_nop ;35 ;NOP
+instr fetch_nop, op_nop, store_nop ;36 ;NOP
+instr fetch_nop, op_nop, store_nop ;37 ;NOP
+instr fetch_nop, op_nop, store_nop ;38 ;NOP
+instr fetch_nop, op_nop, store_nop ;39 ;NOP
+instr fetch_nop, op_nop, store_nop ;3A ;NOP
+instr fetch_nop, op_nop, store_nop ;3B ;NOP
+instr fetch_nop, op_nop, store_nop ;3C ;NOP
+instr fetch_nop, op_nop, store_nop ;3D ;NOP
+instr fetch_nop, op_nop, store_nop ;3E ;NOP
+instr fetch_nop, op_nop, store_nop ;3F ;NOP
+instr fetch_C, op_IN, store2_B ;40 ;IN B,(C)
+instr fetch_B, op_OUT, store_nop ;41 ;OUT (C),B
+instr fetch_BC, op_SBCHL, store_nop ;42 ;SBC HL,BC
+instr fetch_DIR16, op_STBC, store_nop ;43 ;LD (nn),BC
+instr fetch_nop, op_NEG, store_nop ;44 ;NEG
+instr fetch_nop, op_RETN, store_nop ;45 ;RETN
+instr fetch_nop, op_IM0, store_nop ;46 ;IM 0
+instr fetch_nop, op_ldia, store_nop ;47 ;LD I,A
+instr fetch_C, op_IN, store2_C ;48 ;IN C,(C)
+instr fetch_C, op_OUT, store_nop ;49 ;OUT (C),C
+instr fetch_BC, op_ADCHL, store_nop ;4A ;ADC HL,BC
+instr fetch_DIR16, op_RMEM16, store_BC ;4B nn nn ;LD BC,(nn)
+instr fetch_nop, op_NEG, store_nop ;4C ;NEG
+instr fetch_nop, op_RETI, store_nop ;4D ;RETI
+instr fetch_nop, op_IM0, store_nop ;4E ;IM 0
+instr fetch_nop, op_ldra, store_nop ;4F ;LD R,A
+instr fetch_C, op_IN, store2_D ;50 ;IN D,(C)
+instr fetch_D, op_OUT, store_nop ;51 ;OUT (C),D
+instr fetch_DE, op_SBCHL, store_nop ;52 ;SBC HL,DE
+instr fetch_DIR16, op_STDE, store_nop ;53 nn nn ;LD (nn),DE
+instr fetch_nop, op_NEG, store_nop ;54 ;NEG
+instr fetch_nop, op_RETN, store_nop ;55 ;RETN
+instr fetch_nop, op_IM1, store_nop ;56 ;IM 1
+instr fetch_nop, op_ldai, store_nop ;57 ;LD A,I
+instr fetch_C, op_IN, store2_E ;58 ;IN E,(C)
+instr fetch_E, op_OUT, store_nop ;59 ;OUT (C),E
+instr fetch_DE, op_ADCHL, store_nop ;5A ;ADC HL,DE
+instr fetch_DIR16, op_RMEM16, store_DE ;5B nn nn ;LD DE,(nn)
+instr fetch_nop, op_NEG, store_nop ;5C ;NEG
+instr fetch_nop, op_RETN, store_nop ;5D ;RETN
+instr fetch_nop, op_IM2, store_nop ;5E ;IM 2
+instr fetch_nop, op_ldar, store_nop ;5F ;LD A,R
+instr fetch_C, op_IN, store2_H ;60 ;IN H,(C)
+instr fetch_H, op_OUT, store_nop ;61 ;OUT (C),H
+instr fetch_HL, op_SBCHL, store_nop ;62 ;SBC HL,HL
+instr fetch_DIR16, op_STHL, store_nop ;63 nn nn ;LD (nn),HL
+instr fetch_nop, op_NEG, store_nop ;64 ;NEG
+instr fetch_nop, op_RETN, store_nop ;65 ;RETN
+instr fetch_nop, op_IM0, store_nop ;66 ;IM 0
+instr fetch2_mhl, op_RRD, store_mhl ;67 ;RRD
+instr fetch_C, op_IN, store2_L ;68 ;IN L,(C)
+instr fetch_L, op_OUT, store_nop ;69 ;OUT (C),L
+instr fetch_HL, op_ADCHL, store_nop ;6A ;ADC HL,HL
+instr fetch_DIR16, op_RMEM16, store_HL ;6B nn nn ;LD HL,(nn)
+instr fetch_nop, op_NEG, store_nop ;6C ;NEG
+instr fetch_nop, op_RETN, store_nop ;6D ;RETN
+instr fetch_nop, op_IM0, store_nop ;6E ;IM 0
+instr fetch2_mhl, op_RLD, store_mhl ;6F ;RLD
+instr fetch_C, op_IN, store_nop ;70 ;IN (C)
+instr fetch_0, op_OUT, store_nop ;71 ;OUT (C),0
+instr fetch_SP, op_SBCHL, store_nop ;72 ;SBC HL,SP
+instr fetch_DIR16, op_STSP, store_nop ;73 nn nn ;LD (nn),SP
+instr fetch_nop, op_NEG, store_nop ;74 ;NEG
+instr fetch_nop, op_RETN, store_nop ;75 ;RETN
+instr fetch_nop, op_IM1, store_nop ;76 ;IM 1
+instr fetch_nop, op_nop, store_nop ;77 ;NOP
+instr fetch_C, op_IN, store2_A ;78 ;IN A,(C)
+instr fetch_A, op_OUT, store_nop ;79 ;OUT (C),A
+instr fetch_SP, op_ADCHL, store_nop ;7A ;ADC HL,SP
+instr fetch_DIR16, op_RMEM16, store_SP ;7B nn nn ;LD SP,(nn)
+instr fetch_nop, op_NEG, store_nop ;7C ;NEG
+instr fetch_nop, op_RETN, store_nop ;7D ;RETN
+instr fetch_nop, op_IM2, store_nop ;7E ;IM 2
+instr fetch_nop, op_nop, store_nop ;7F ;NOP
+instr fetch_nop, op_nop, store_nop ;80 ;NOP
+instr fetch_nop, op_nop, store_nop ;81 ;NOP
+instr fetch_nop, op_nop, store_nop ;82 ;NOP
+instr fetch_nop, op_nop, store_nop ;83 ;NOP
+instr fetch_nop, op_nop, store_nop ;84 ;NOP
+instr fetch_nop, op_nop, store_nop ;85 ;NOP
+instr fetch_nop, op_nop, store_nop ;86 ;NOP
+instr fetch_nop, op_nop, store_nop ;87 ;NOP
+instr fetch_nop, op_nop, store_nop ;88 ;NOP
+instr fetch_nop, op_nop, store_nop ;89 ;NOP
+instr fetch_nop, op_nop, store_nop ;8A ;NOP
+instr fetch_nop, op_nop, store_nop ;8B ;NOP
+instr fetch_nop, op_nop, store_nop ;8C ;NOP
+instr fetch_nop, op_nop, store_nop ;8D ;NOP
+instr fetch_nop, op_nop, store_nop ;8E ;NOP
+instr fetch_nop, op_nop, store_nop ;8F ;NOP
+instr fetch_nop, op_nop, store_nop ;90 ;NOP
+instr fetch_nop, op_nop, store_nop ;91 ;NOP
+instr fetch_nop, op_nop, store_nop ;92 ;NOP
+instr fetch_nop, op_nop, store_nop ;93 ;NOP
+instr fetch_nop, op_nop, store_nop ;94 ;NOP
+instr fetch_nop, op_nop, store_nop ;95 ;NOP
+instr fetch_nop, op_nop, store_nop ;96 ;NOP
+instr fetch_nop, op_nop, store_nop ;97 ;NOP
+instr fetch_nop, op_nop, store_nop ;98 ;NOP
+instr fetch_nop, op_nop, store_nop ;99 ;NOP
+instr fetch_nop, op_nop, store_nop ;9A ;NOP
+instr fetch_nop, op_nop, store_nop ;9B ;NOP
+instr fetch_nop, op_nop, store_nop ;9C ;NOP
+instr fetch_nop, op_nop, store_nop ;9D ;NOP
+instr fetch_nop, op_nop, store_nop ;9E ;NOP
+instr fetch_nop, op_nop, store_nop ;9F ;NOP
+instr fetch_nop, op_LDI, store_nop ;A0 ;LDI
+instr fetch_nop, op_CPI, store_nop ;A1 ;CPI
+instr fetch_nop, op_INI, store_nop ;A2 ;INI
+instr fetch_nop, op_OUTI, store_nop ;A3 ;OUTI
+instr fetch_nop, op_nop, store_nop ;A4 ;NOP
+instr fetch_nop, op_nop, store_nop ;A5 ;NOP
+instr fetch_nop, op_nop, store_nop ;A6 ;NOP
+instr fetch_nop, op_nop, store_nop ;A7 ;NOP
+instr fetch_nop, op_LDD, store_nop ;A8 ;LDD
+instr fetch_nop, op_CPD, store_nop ;A9 ;CPD
+instr fetch_nop, op_IND, store_nop ;AA ;IND
+instr fetch_nop, op_OUTD, store_nop ;AB ;OUTD
+instr fetch_nop, op_nop, store_nop ;AC ;NOP
+instr fetch_nop, op_nop, store_nop ;AD ;NOP
+instr fetch_nop, op_nop, store_nop ;AE ;NOP
+instr fetch_nop, op_nop, store_nop ;AF ;NOP
+instr fetch_nop, op_LDIR, store_nop ;B0 ;LDIR
+instr fetch_nop, op_CPIR, store_nop ;B1 ;CPIR
+instr fetch_nop, op_INIR, store_nop ;B2 ;INIR
+instr fetch_nop, op_OTIR, store_nop ;B3 ;OTIR
+instr fetch_nop, op_nop, store_nop ;B4 ;NOP
+instr fetch_nop, op_nop, store_nop ;B5 ;NOP
+instr fetch_nop, op_nop, store_nop ;B6 ;NOP
+instr fetch_nop, op_nop, store_nop ;B7 ;NOP
+instr fetch_nop, op_LDDR, store_nop ;B8 ;LDDR
+instr fetch_nop, op_CPDR, store_nop ;B9 ;CPDR
+instr fetch_nop, op_INDR, store_nop ;BA ;INDR
+instr fetch_nop, op_OTDR, store_nop ;BB ;OTDR
+instr fetch_nop, op_nop, store_nop ;BC ;NOP
+instr fetch_nop, op_nop, store_nop ;BD ;NOP
+instr fetch_nop, op_nop, store_nop ;BE ;NOP
+instr fetch_nop, op_nop, store_nop ;BF ;NOP
+instr fetch_nop, op_nop, store_nop ;C0 ;NOP
+instr fetch_nop, op_nop, store_nop ;C1 ;NOP
+instr fetch_nop, op_nop, store_nop ;C2 ;NOP
+instr fetch_nop, op_nop, store_nop ;C3 ;NOP
+instr fetch_nop, op_nop, store_nop ;C4 ;NOP
+instr fetch_nop, op_nop, store_nop ;C5 ;NOP
+instr fetch_nop, op_nop, store_nop ;C6 ;NOP
+instr fetch_nop, op_nop, store_nop ;C7 ;NOP
+instr fetch_nop, op_nop, store_nop ;C8 ;NOP
+instr fetch_nop, op_nop, store_nop ;C9 ;NOP
+instr fetch_nop, op_nop, store_nop ;CA ;NOP
+instr fetch_nop, op_nop, store_nop ;CB ;NOP
+instr fetch_nop, op_nop, store_nop ;CC ;NOP
+instr fetch_nop, op_nop, store_nop ;CD ;NOP
+instr fetch_nop, op_nop, store_nop ;CE ;NOP
+instr fetch_nop, op_nop, store_nop ;CF ;NOP
+instr fetch_nop, op_nop, store_nop ;D0 ;NOP
+instr fetch_nop, op_nop, store_nop ;D1 ;NOP
+instr fetch_nop, op_nop, store_nop ;D2 ;NOP
+instr fetch_nop, op_nop, store_nop ;D3 ;NOP
+instr fetch_nop, op_nop, store_nop ;D4 ;NOP
+instr fetch_nop, op_nop, store_nop ;D5 ;NOP
+instr fetch_nop, op_nop, store_nop ;D6 ;NOP
+instr fetch_nop, op_nop, store_nop ;D7 ;NOP
+instr fetch_nop, op_nop, store_nop ;D8 ;NOP
+instr fetch_nop, op_nop, store_nop ;D9 ;NOP
+instr fetch_nop, op_nop, store_nop ;DA ;NOP
+instr fetch_nop, op_nop, store_nop ;DB ;NOP
+instr fetch_nop, op_nop, store_nop ;DC ;NOP
+instr fetch_nop, op_nop, store_nop ;DD ;NOP
+instr fetch_nop, op_nop, store_nop ;DE ;NOP
+instr fetch_nop, op_nop, store_nop ;DF ;NOP
+instr fetch_nop, op_nop, store_nop ;E0 ;NOP
+instr fetch_nop, op_nop, store_nop ;E1 ;NOP
+instr fetch_nop, op_nop, store_nop ;E2 ;NOP
+instr fetch_nop, op_nop, store_nop ;E3 ;NOP
+instr fetch_nop, op_nop, store_nop ;E4 ;NOP
+instr fetch_nop, op_nop, store_nop ;E5 ;NOP
+instr fetch_nop, op_nop, store_nop ;E6 ;NOP
+instr fetch_nop, op_nop, store_nop ;E7 ;NOP
+instr fetch_nop, op_nop, store_nop ;E8 ;NOP
+instr fetch_nop, op_nop, store_nop ;E9 ;NOP
+instr fetch_nop, op_nop, store_nop ;EA ;NOP
+instr fetch_nop, op_nop, store_nop ;EB ;NOP
+instr fetch_nop, op_nop, store_nop ;EC ;NOP
+instr fetch_nop, op_nop, store_nop ;ED ;NOP
+instr fetch_nop, op_nop, store_nop ;EE ;NOP
+instr fetch_nop, op_nop, store_nop ;EF ;NOP
+instr fetch_nop, op_nop, store_nop ;F0 ;NOP
+instr fetch_nop, op_nop, store_nop ;F1 ;NOP
+instr fetch_nop, op_nop, store_nop ;F2 ;NOP
+instr fetch_nop, op_nop, store_nop ;F3 ;NOP
+instr fetch_nop, op_nop, store_nop ;F4 ;NOP
+instr fetch_nop, op_nop, store_nop ;F5 ;NOP
+instr fetch_nop, op_nop, store_nop ;F6 ;NOP
+instr fetch_nop, op_nop, store_nop ;F7 ;NOP
+instr fetch_nop, op_nop, store_nop ;F8 ;NOP
+instr fetch_nop, op_nop, store_nop ;F9 ;NOP
+instr fetch_nop, op_nop, store_nop ;FA ;NOP
+instr fetch_nop, op_nop, store_nop ;FB ;NOP
+instr fetch_nop, op_nop, store_nop ;FC ;NOP
+instr fetch_nop, op_nop, store_nop ;FD ;NOP
+instr fetch_nop, op_nop, store_nop ;FE ;NOP
+instr fetch_nop, op_nop, store_nop ;FF ;NOP
+#endif