]> cloudbase.mooo.com Git - avrcpm.git/commitdiff
* avr/Z80int-jmp.asm
authorLeo <erbl259-lmu@yahoo.de>
Fri, 23 Mar 2012 21:14:55 +0000 (21:14 +0000)
committerLeo <erbl259-lmu@yahoo.de>
Fri, 23 Mar 2012 21:14:55 +0000 (21:14 +0000)
  - Z80 instruction set now complete.
  - DAA if N=1 works
  - INC/DEC really fixed now
  - DJNZ optimization by Joe G.
* avr/utils.asm
  - printregs: Z80 alternate registers lower case

git-svn-id: svn://cu.loc/avr-cpm/avrcpm/trunk@186 57430480-672e-4586-8877-bcf8adbbf3b7

avr/Z80int-jmp.asm
avr/utils.asm

index 6641a924dd2669f98748e0eef78b9e64ad0127e5..a5733ada568f0b6c9b4cc7aa73acfb825fba5263 100644 (file)
@@ -472,12 +472,6 @@ do_fetch_dir8:
        adiw z_pcl,1
        ret
 
-do_fetch_dir8_2:
-       movw    xl,z_pcl
-       adiw    xl,1
-       mem_read_d opl
-       ret
-
 do_fetch_dir16:
        mem_read_ds opl, z_pc
        adiw z_pcl,1
@@ -585,6 +579,7 @@ do_store_pc:
        ret
 
 do_store_pcrel:                                ;add displacement to PC
+#if EM_Z80
        clr     oph
        tst     opl                     ;sign extend
        brpl    stpcr1
@@ -593,7 +588,9 @@ stpcr1:
        add     z_pcl,opl
        adc     z_pch,oph
        ret
-
+#else
+       rjmp    do_op_inv
+#endif
 
 do_store_ret:
        movw    x,z_spl
@@ -847,7 +844,7 @@ do_store_am:
 ;
 ;      ldpmx   dstreg,tablebase,indexreg
 ;
-; (6 words, 8 cycles)
+; (3 words, 5 cycles)
 
 .macro ldpmx
        ldi     zh,high(@1*2)   ; table must be page aligned
@@ -894,7 +891,7 @@ do_store_am:
        
 .macro do_z80_flags_copy_HC
 #if EM_Z80
-       bmov    z_flags, ZFL_H, z_flags, ZFL_H
+       bmov    z_flags, ZFL_H, z_flags, ZFL_C
 #endif
 .endm
 
@@ -1008,39 +1005,37 @@ do_op_ina:                              ; in a,(opl)
 ;
 
 do_op_inc:
-       andi    z_flags,(1<<ZFL_C)              ; preserve C-flag
+#if EM_Z80
+       andi    z_flags,(1<<ZFL_C)              ; preserve C-, Clear N-flag
        ldi     temp,1
        add     opl,temp
-#if EM_Z80
-       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)
-       brvc    PC+2
-        sbr    z_flags,(1<<ZFL_P)
+       in      temp,sreg
+       bmov    z_flags,ZFL_S, temp,AVR_N
+       bmov    z_flags,ZFL_Z, temp,AVR_Z
+       bmov    z_flags,ZFL_H, temp,AVR_H
+       bmov    z_flags,ZFL_P, temp,AVR_V
 #else /* 8080 */
+       andi    z_flags,(1<<ZFL_C)|(1<<ZFL_H)   ; preserve C- and H-flag
+       inc     opl
        ldpmx   temp,sz53p_tab,opl              ;S,Z,P flag
        or      z_flags,temp
 #endif
        ret
 
 do_op_inca:
-       andi    z_flags,(1<<ZFL_C)              ; preserve C-flag
+#if EM_Z80
+       andi    z_flags,(1<<ZFL_C)              ; preserve C-, Clear N-flag
        ldi     temp,1
        add     z_a,temp
-#if EM_Z80
-       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)
-       brvc    PC+2
-        sbr    z_flags,(1<<ZFL_P)
+       in      temp,sreg
+       bmov    z_flags,ZFL_S, temp,AVR_N
+       bmov    z_flags,ZFL_Z, temp,AVR_Z
+       bmov    z_flags,ZFL_H, temp,AVR_H
+       bmov    z_flags,ZFL_P, temp,AVR_V
 #else /* 8080 */
-       ldpmx   temp,sz53p_tab,opl              ;S,Z,P flag
+       andi    z_flags,(1<<ZFL_C)|(1<<ZFL_H)   ; preserve C- and H-flag
+       inc     z_a
+       ldpmx   temp,sz53p_tab,z_a              ; S,Z,P flag
        or      z_flags,temp
 #endif
        ret
@@ -1057,19 +1052,16 @@ do_op_inca:
 ;
 
 do_op_dec:
-       andi    z_flags,(1<<ZFL_C)              ; preserve C-flag
        subi    opl,1
 #if EM_Z80
-       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)
-       brvc    PC+2
-        sbr    z_flags,(1<<ZFL_P)
+       in      temp,sreg
+       bmov    z_flags,ZFL_S, temp,AVR_N
+       bmov    z_flags,ZFL_Z, temp,AVR_Z
+       bmov    z_flags,ZFL_H, temp,AVR_H
+       bmov    z_flags,ZFL_P, temp,AVR_V
        ori     z_flags,(1<<ZFL_N)              ; Set N-flag
 #else /* 8080 */
+       andi    z_flags,(1<<ZFL_C)|(1<<ZFL_H)   ; preserve C- and H-flag
        ldpmx   temp,sz53p_tab,opl              ; S,Z,P flag
        or      z_flags,temp
 #endif
@@ -1077,21 +1069,19 @@ do_op_dec:
 
 
 do_op_deca:
-       andi    z_flags,(1<<ZFL_C)              ; preserve C-flag
-       ldi     temp,1
 #if EM_Z80
+       ldi     temp,1
        sub     z_a,temp
-       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)
-       brvc    PC+2
-        sbr    z_flags,(1<<ZFL_P)
+       in      temp,sreg
+       bmov    z_flags,ZFL_S, temp,AVR_N
+       bmov    z_flags,ZFL_Z, temp,AVR_Z
+       bmov    z_flags,ZFL_H, temp,AVR_H
+       bmov    z_flags,ZFL_P, temp,AVR_V
        ori     z_flags,(1<<ZFL_N)              ; Set N-flag
 #else /* 8080 */
-       ldpmx   temp,sz53p_tab,opl              ; S,Z,P flag
+       dec     z_a
+       andi    z_flags,(1<<ZFL_C)|(1<<ZFL_H)   ; preserve C- and H-flag
+       ldpmx   temp,sz53p_tab,z_a              ; S,Z,P flag
        or      z_flags,temp
 #endif
        ret
@@ -1401,8 +1391,7 @@ do_op_rmem8:
 ;----------------------------------------------------------------
 ;|DAA       |***P-*|Decimal Adjust Acc.  |                      |
 ;|----------|SZHP C|---------- 8080 ----------------------------|
-;
-; Not yet checked
+
 
 ; Description (http://www.z80.info/z80syntx.htm#DAA):
 ;  This instruction conditionally adjusts the accumulator for BCD addition
@@ -1449,17 +1438,18 @@ do_op_rmem8:
 ;     Z:   Set if Acc. is Zero after operation, reset otherwise.
 ;     S:   Set if most significant bit of Acc. is 1 after operation, reset otherwise.
 
-#if 1
 
-do_op_daa:
+
+#if 0
 
 #if EM_Z80
        sbrc    z_flags,ZFL_N                   ;if add-op      
        rjmp    op_da_sub                       ;then
 #endif
 
+do_op_DAA:
 op_da_add:
-       ldi     temp2,0                         ;  new C and H flag
+       ldi     temp2,0                         ;  new C, H and N flag
        sbrc    z_flags,ZFL_H                   ;  |
        rjmp    op_da_a01                       ;  if (H flag ...
        mov     temp,opl                        ;  |
@@ -1491,19 +1481,48 @@ op_da_a13:                                      ;
 #if EM_Z80
 
 op_da_sub:                                     ;else (sub-op)
-       rjmp    op_da_add                       ;  TODO: ! Z80 DAA whith N flag set.
-       ret                                     ;endif
+       ldi     temp2,(1<<ZFL_N)                ;  new C, H and N flag
+       sbrc    z_flags,ZFL_H                   ;  |
+       rjmp    op_da_s01                       ;  if (H flag ...
+       mov     temp,opl                        ;  |
+       andi    temp,0x0f                       ;  |
+       cpi     temp,0x0a                       ;  or (lower nibble >= 0x0A))
+       brlo    op_da_s10                       ;  |
+op_da_s01:                                     ;  then
+       ldi     oph,0x06                        ;    add 6 to lower nibble
+       sub     opl,oph                         ;    
+       brhc    PC+2                            ;    if 
+        ori    temp2,(1<<ZFL_H)                ;      set new H flag
+       brcc    op_da_s10                       ;    if
+       ori     temp2,(1<<ZFL_C)                ;      set new C flag
+op_da_s10:                                     ;  endif
+       sbrc    z_flags,ZFL_C                   ;  |
+       rjmp    op_da_s12                       ;  if (C flag ...
+       cpi     opl,0x90                        ;  |... or upper nibble >= 0xA0)
+       brlo    op_da_s13                       ; 
+op_da_s12:                                     ;
+       ldi     oph,0x60                        ;    add 6 to lower nibble
+       sub     opl,oph                         ;
+       ori     temp2,(1<<ZFL_C)                ;      set new C flag
+op_da_s13:                                     ;
+       ldpmx   z_flags, sz53p_tab, opl         ;  get S,Z,P flag
+       or      z_flags,temp2                   ;  merge new C and H flag
+       ret
+
 #endif
 
 #else
 
-do_op_da:
-       ldi     temp2,0                         ;new C and H flag
+do_op_DAA:
        ldi     oph,0                           ;oph: what to add
 
+#if EM_Z80
        sbrc    z_flags,ZFL_N                   ;if add-op      
        rjmp    op_da_sub                       ;then
+#endif
+
 op_da_add:
+       ldi     temp2,0                         ;  new C, H and N flag
        mov     temp,opl                        ;  |
        andi    temp,0x0f                       ;  |
        cpi     temp,0x0a                       ;  if (lower nibble >= 0x0A)
@@ -1534,9 +1553,9 @@ op_da_a13:
        ori     oph,0x06                        ;      add 0x06
        mov     temp,opl                        ;      |
        andi    temp,0x0f                       ;      |
-       cpi     temp,0x06                       ;      if (lower nibble >= 0x0A)
+       cpi     temp,0x06                       ;      if (lower nibble < 0x6)
        brsh    op_da_ae                        ;      |
-       ori     temp2,(1<<ZFL_H)                ;        set new H flag
+;      ori     temp2,(1<<ZFL_H)                ;        set new H flag
                                                ;      endif
                                                ;    endif
 op_da_ae:
@@ -1545,10 +1564,52 @@ op_da_ae:
        or      z_flags,temp2                   ; merge new C and H flag
        ret
 
+#if EM_Z80
+
 op_da_sub:                                     ;else (sub-op)
-       rcall do_op_inv                         ;  TODO: !
+       ldi     temp2,(1<<ZFL_N)                ;  new C, H and N flag
+       mov     temp,opl                        ;  |
+       andi    temp,0x0f                       ;  |
+       cpi     temp,0x0a                       ;  if (lower nibble >= 0x0A)
+       brlo    op_da_s10                       ;  |
+       ori     oph,0x06                        ;    sub 6
+
+       sbrc    z_flags,ZFL_C                   ;    |
+       rjmp    op_da_s02                       ;    if (C flag ...
+       cpi     opl,0x90                        ;    |... or upper nibble >= 0x90)
+       brlo    op_da_s03                       ;    |
+op_da_s02:                             
+       ori     oph,0x60                        ;      sub 0x60
+       ori     temp2,(1<<ZFL_C)                ;      set new C flag
+op_da_s03:                                     ;    endif
+       rjmp    op_da_se
+op_da_s10:                                     ;  else (lower nibble is 0x09 or lower)
+       sbrc    z_flags,ZFL_C                   ;    |
+       rjmp    op_da_s12                       ;    if (C flag ...
+       cpi     opl,0xA0                        ;    |... or upper nibble >= 0xA0)
+       brlo    op_da_s13                       ; 
+op_da_s12:                             
+       ori     oph,0x60                        ;      sub 0x60
+       ori     temp2,(1<<ZFL_C)                ;      set new C flag
+op_da_s13:
+       sbrs    z_flags,ZFL_H                   ;    if (H flag)
+       rjmp    op_da_se                        ;    |
+       ori     oph,0x06                        ;      sub 0x06
+       mov     temp,opl                        ;      |
+       andi    temp,0x0f                       ;      |
+       cpi     temp,0x06                       ;      if (lower nibble < 0x06)
+       brcc    op_da_se                        ;      |
+       ori     temp2,(1<<ZFL_H)                ;        set new H flag
+                                               ;      endif
+                                               ;    endif
+op_da_se:
+       sub     opl,oph
+       ldpmx   z_flags, sz53p_tab, opl         ; get S,Z,P flag
+       or      z_flags,temp2                   ; merge new C and H flag
        ret                                     ;endif
-#endif
+
+#endif  /* EM_Z80 */
+#endif  /* alternatives */
 
 
 ;----------------------------------------------------------------
@@ -1813,6 +1874,27 @@ do_op_ifm: ;sign negative, aka s=1
 ;----------------------------------------------------------------
 ;|DJNZ e    |------|Dec., Jump Non-Zero  |B=B-1 till B=0        |
 ;
+;The b register is decremented, and if not zero, the signed value e is added to pc.
+;The jump is measured from the start of the instruction opcode.
+;e = Relative addressing (PC=PC+2+offset)
+
+#if 1
+
+                               ; (Joe G.)
+do_op_DJNZ:                    ; decremt B, jump B=0
+       ldd     temp,y+oz_b     ; B in temp
+       dec     temp            ; temp decrementieren
+       std     y+oz_b,temp     ; temp in B
+       breq    do_op_DJNZ_Z    ; bei B=0
+       subi    opl, 0x80       ; z_pc + e im Zweierkomplement
+       subi    z_pcl,0x80
+       sbc     z_pch,_0
+       add     z_pcl,opl
+       adc     z_pch,_0
+do_op_DJNZ_Z:
+       ret
+
+#else
 
 do_op_djnz:
        ldd     temp,y+oz_b
@@ -1820,10 +1902,11 @@ do_op_djnz:
        std     y+oz_b,temp
        brne    opdjnze
        pop     temp                            ; nix tun
-       pop     temp                            ; direkt zuruech zu main        
+       pop     temp                            ; direkt zurueck zu main        
 opdjnze:
        ret
 
+#endif
 
 ;----------------------------------------------------------------
 ;|Mnemonic  |SZHPNC|Description          |Notes                 |
@@ -1862,11 +1945,16 @@ opexx_loop:
 do_op_djnz:
 do_op_EXAF:
 do_op_EXX:
+       ljmp    do_op_inv
        ret
 #endif
 
 #if EM_Z80
 
+do_op_noni:
+       sbiw    z_pcl,1                         ;--z_pc
+       ret
+
 do_op_prefixED:
        mem_read_ds zl,z_pc                     ;zl = memReadByte(z_pc)
        adiw    z_pcl,1                         ;++z_pc
@@ -1930,6 +2018,7 @@ do_op_prefixED:
 do_op_prefixDD:
 do_op_prefixFD:
 do_op_prefixCB:
+       ljmp    do_op_inv
        ret
 #endif
 
@@ -1958,7 +2047,7 @@ instr     fetch_C,        op_INC,         store_C         ;0C             ;INC C
 instr  fetch_C,        op_DEC,         store_C         ;0D             ;DEC C
 instr  fetch_DIR8,     op_nop,         store_C         ;0E nn          ;LD C,n
 instr  fetch_nop,      op_RRCA,        store_nop       ;0F             ;RRCA
-instr  fetch_DIR8,     op_DJNZ,        store_pcrel     ;10 oo          ;DJNZ o
+instr  fetch_DIR8,     op_DJNZ,        store_nop       ;10 oo          ;DJNZ o
 instr  fetch_DIR16,    op_nop,         store_DE        ;11 nn nn       ;LD DE,nn
 instr  fetch_nop,      op_nop,         store_MDE       ;12             ;LD (DE),A
 instr  fetch_DE,       op_INC16,       store_DE        ;13             ;INC DE
@@ -2208,6 +2297,12 @@ do_fetch_0:
        ldi     opl,0
        ret
 
+do_fetch_dir8_2:
+       movw    xl,z_pcl
+       adiw    xl,1
+       mem_read_d opl
+       ret
+
 ;----------------------------------------------------------------
 ;|Mnemonic  |SZHPNC|Description          |Notes                 |
 ;----------------------------------------------------------------
@@ -2506,7 +2601,7 @@ fetchmxx2:
        add     xl,opl                          ;add displacement
        adc     xh,oph
        mem_read_d opl                          ;get operand
-       ret
+       ret                                     ;(Ix+d) still in xl,xh
 
 
 do_fetch_xx:
@@ -2556,6 +2651,10 @@ storemxx2:
        mem_write_s opl                         ;store operand
        ret
 
+do_store_mxx_0:
+       mem_write_s opl                         ;store operand
+       ret
+
 do_store_mxx_2:
        sbic    flags,prefixfd
        rjmp    storemxx2_fd
@@ -2813,7 +2912,7 @@ op_INxx_common:
        lcall   dram_write
        ldd     temp,y+oz_b             ;B
        dec     temp
-       std     y+oz_b,oph              ;B
+       std     y+oz_b,temp             ;B
        brne    PC+2
         sbr    z_flags,(1<<ZFL_Z)
        ret
@@ -2841,7 +2940,7 @@ do_op_INIR:
 
 do_op_INDR:
        rcall   do_op_IND
-       sbrs    z_flags,ZFL_P
+       sbrc    z_flags,ZFL_Z
         ret
        sbiw    z_pcl,2
        ret
@@ -2896,7 +2995,7 @@ do_op_OTIR:
 
 do_op_OTDR:
        rcall   do_op_OUTD
-       sbrs    z_flags,ZFL_P
+       sbrc    z_flags,ZFL_Z
         ret
        sbiw    z_pcl,2
        ret
@@ -3406,107 +3505,107 @@ instr         fetch_nop,      op_nop,         store_nop       ;FF             ;NOP
 
        opctable        DDFDjmp
 
-instr  fetch_nop,      op_nop,         store_nop       ;00             ;
-instr  fetch_nop,      op_nop,         store_nop       ;01             ;
-instr  fetch_nop,      op_nop,         store_nop       ;02             ;
-instr  fetch_nop,      op_nop,         store_nop       ;03             ;
-instr  fetch_nop,      op_nop,         store_nop       ;04             ;
-instr  fetch_nop,      op_nop,         store_nop       ;05             ;
-instr  fetch_nop,      op_nop,         store_nop       ;06             ;
-instr  fetch_nop,      op_nop,         store_nop       ;07             ;
-instr  fetch_nop,      op_nop,         store_nop       ;08             ;
+instr  fetch_nop,      op_noni,                store_nop       ;00             ;
+instr  fetch_nop,      op_noni,        store_nop       ;01             ;
+instr  fetch_nop,      op_noni,        store_nop       ;02             ;
+instr  fetch_nop,      op_noni,        store_nop       ;03             ;
+instr  fetch_nop,      op_noni,        store_nop       ;04             ;
+instr  fetch_nop,      op_noni,        store_nop       ;05             ;
+instr  fetch_nop,      op_noni,        store_nop       ;06             ;
+instr  fetch_nop,      op_noni,        store_nop       ;07             ;
+instr  fetch_nop,      op_noni,        store_nop       ;08             ;
 instr  fetch_BC,       op_ADDxx,       store_nop       ;09             ;ADD xx,BC
-instr  fetch_nop,      op_nop,         store_nop       ;0A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;0B             ;
-instr  fetch_nop,      op_nop,         store_nop       ;0C             ;
-instr  fetch_nop,      op_nop,         store_nop       ;0D             ;
-instr  fetch_nop,      op_nop,         store_nop       ;0E             ;
-instr  fetch_nop,      op_nop,         store_nop       ;0F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;10             ;
-instr  fetch_nop,      op_nop,         store_nop       ;11             ;
-instr  fetch_nop,      op_nop,         store_nop       ;12             ;
-instr  fetch_nop,      op_nop,         store_nop       ;13             ;
-instr  fetch_nop,      op_nop,         store_nop       ;14             ;
-instr  fetch_nop,      op_nop,         store_nop       ;15             ;
-instr  fetch_nop,      op_nop,         store_nop       ;16             ;
-instr  fetch_nop,      op_nop,         store_nop       ;17             ;
-instr  fetch_nop,      op_nop,         store_nop       ;18             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0C             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0D             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0E             ;
+instr  fetch_nop,      op_noni,        store_nop       ;0F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;10             ;
+instr  fetch_nop,      op_noni,        store_nop       ;11             ;
+instr  fetch_nop,      op_noni,        store_nop       ;12             ;
+instr  fetch_nop,      op_noni,        store_nop       ;13             ;
+instr  fetch_nop,      op_noni,        store_nop       ;14             ;
+instr  fetch_nop,      op_noni,        store_nop       ;15             ;
+instr  fetch_nop,      op_noni,        store_nop       ;16             ;
+instr  fetch_nop,      op_noni,        store_nop       ;17             ;
+instr  fetch_nop,      op_noni,        store_nop       ;18             ;
 instr  fetch_DE,       op_ADDxx,       store_nop       ;19             ;ADD xx,DE
-instr  fetch_nop,      op_nop,         store_nop       ;1A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;1B             ;
-instr  fetch_nop,      op_nop,         store_nop       ;1C             ;
-instr  fetch_nop,      op_nop,         store_nop       ;1D             ;
-instr  fetch_nop,      op_nop,         store_nop       ;1E             ;
-instr  fetch_nop,      op_nop,         store_nop       ;1F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;20             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1C             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1D             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1E             ;
+instr  fetch_nop,      op_noni,        store_nop       ;1F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;20             ;
 instr  fetch_DIR16,    op_nop,         store_xx        ;21             ;LD xx,nn
 instr  fetch_DIR16,    op_STxx,        store_nop       ;22             ;LD (nn),xx
 instr  fetch_xx,       op_INC16,       store_xx        ;23             ;INC xx
 instr  fetch_xH,       op_INC,         store_xH        ;24             ;INC xh
 instr  fetch_xH,       op_DEC,         store_xH        ;25             ;DEC xh
 instr  fetch_DIR8,     op_nop,         store_xH        ;26             ;LD xh,n
-instr  fetch_nop,      op_nop,         store_nop       ;27             ;
-instr  fetch_nop,      op_nop,         store_nop       ;28             ;
+instr  fetch_nop,      op_noni,        store_nop       ;27             ;
+instr  fetch_nop,      op_noni,        store_nop       ;28             ;
 instr  fetch_xx,       op_ADDxx,       store_nop       ;29             ;ADD xx,xx
 instr  fetch_DIR16,    op_RMEM16,      store_xx        ;2A             ;LD xx,(nn)
 instr  fetch_xx,       op_DEC16,       store_xx        ;2B             ;DEC xx
 instr  fetch_xL,       op_INC,         store_xL        ;2C             ;INC xl
 instr  fetch_xL,       op_DEC,         store_xL        ;2D             ;DEC xl
 instr  fetch_DIR8,     op_nop,         store_xL        ;2E             ;LD xl,n
-instr  fetch_nop,      op_nop,         store_nop       ;2F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;30             ;
-instr  fetch_nop,      op_nop,         store_nop       ;31             ;
-instr  fetch_nop,      op_nop,         store_nop       ;32             ;
-instr  fetch_nop,      op_nop,         store_nop       ;33             ;
-instr  fetch_MXX,      op_INC,         store_MXX       ;34             ;INC (xx+d)
-instr  fetch_MXX,      op_DEC,         store_MXX       ;35             ;DEC (xx+d)
+instr  fetch_nop,      op_noni,        store_nop       ;2F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;30             ;
+instr  fetch_nop,      op_noni,        store_nop       ;31             ;
+instr  fetch_nop,      op_noni,        store_nop       ;32             ;
+instr  fetch_nop,      op_noni,        store_nop       ;33             ;
+instr  fetch_MXX,      op_INC,         store_MXX_0     ;34             ;INC (xx+d)
+instr  fetch_MXX,      op_DEC,         store_MXX_0     ;35             ;DEC (xx+d)
 instr  fetch_DIR8_2,   op_nop,         store_MXX_2     ;36             ;LD (xx+d),n
-instr  fetch_nop,      op_nop,         store_nop       ;37             ;
-instr  fetch_nop,      op_nop,         store_nop       ;38             ;
+instr  fetch_nop,      op_noni,        store_nop       ;37             ;
+instr  fetch_nop,      op_noni,        store_nop       ;38             ;
 instr  fetch_SP,       op_ADDxx,       store_nop       ;39             ;ADD xx,SP
-instr  fetch_nop,      op_nop,         store_nop       ;3A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;3B             ;
-instr  fetch_nop,      op_nop,         store_nop       ;3C             ;
-instr  fetch_nop,      op_nop,         store_nop       ;3D             ;
-instr  fetch_nop,      op_nop,         store_nop       ;3E             ;
-instr  fetch_nop,      op_nop,         store_nop       ;3F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;40             ;
-instr  fetch_nop,      op_nop,         store_nop       ;41             ;
-instr  fetch_nop,      op_nop,         store_nop       ;42             ;
-instr  fetch_nop,      op_nop,         store_nop       ;43             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3C             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3D             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3E             ;
+instr  fetch_nop,      op_noni,        store_nop       ;3F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;40             ;
+instr  fetch_nop,      op_noni,        store_nop       ;41             ;
+instr  fetch_nop,      op_noni,        store_nop       ;42             ;
+instr  fetch_nop,      op_noni,        store_nop       ;43             ;
 instr  fetch_xH,       op_nop,         store_B         ;44             ;LD B,xh
 instr  fetch_xL,       op_nop,         store_B         ;45             ;LD B,xl
 instr  fetch_MXX,      op_nop,         store_B         ;46             ;LD B,(xx+d)
-instr  fetch_nop,      op_nop,         store_nop       ;47             ;
-instr  fetch_nop,      op_nop,         store_nop       ;48             ;
-instr  fetch_nop,      op_nop,         store_nop       ;49             ;
-instr  fetch_nop,      op_nop,         store_nop       ;4A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;4B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;47             ;
+instr  fetch_nop,      op_noni,        store_nop       ;48             ;
+instr  fetch_nop,      op_noni,        store_nop       ;49             ;
+instr  fetch_nop,      op_noni,        store_nop       ;4A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;4B             ;
 instr  fetch_xH,       op_nop,         store_C         ;4C             ;LD C,xh
 instr  fetch_xL,       op_nop,         store_C         ;4D             ;LD C,xl
 instr  fetch_MXX,      op_nop,         store_C         ;4E             ;LD C,(xx+d)
-instr  fetch_nop,      op_nop,         store_nop       ;4F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;50             ;
-instr  fetch_nop,      op_nop,         store_nop       ;51             ;
-instr  fetch_nop,      op_nop,         store_nop       ;52             ;
-instr  fetch_nop,      op_nop,         store_nop       ;53             ;
+instr  fetch_nop,      op_noni,        store_nop       ;4F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;50             ;
+instr  fetch_nop,      op_noni,        store_nop       ;51             ;
+instr  fetch_nop,      op_noni,        store_nop       ;52             ;
+instr  fetch_nop,      op_noni,        store_nop       ;53             ;
 instr  fetch_xH,       op_nop,         store_D         ;54             ;LD D,xh
 instr  fetch_xL,       op_nop,         store_D         ;55             ;LD D,xl
 instr  fetch_MXX,      op_nop,         store_D         ;56             ;LD D,(xx+d)
-instr  fetch_nop,      op_nop,         store_nop       ;57             ;
-instr  fetch_nop,      op_nop,         store_nop       ;58             ;
-instr  fetch_nop,      op_nop,         store_nop       ;59             ;
-instr  fetch_nop,      op_nop,         store_nop       ;5A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;5B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;57             ;
+instr  fetch_nop,      op_noni,        store_nop       ;58             ;
+instr  fetch_nop,      op_noni,        store_nop       ;59             ;
+instr  fetch_nop,      op_noni,        store_nop       ;5A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;5B             ;
 instr  fetch_xH,       op_nop,         store_E         ;5C             ;LD E,xh
 instr  fetch_xL,       op_nop,         store_E         ;5D             ;LD E,xl
 instr  fetch_MXX,      op_nop,         store_E         ;5E             ;LD E,(xx+d)
-instr  fetch_nop,      op_nop,         store_nop       ;5F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;5F             ;
 instr  fetch_B,        op_nop,         store_xH        ;60             ;LD xh,B
 instr  fetch_C,        op_nop,         store_xH        ;61             ;LD xh,C
 instr  fetch_D,        op_nop,         store_xH        ;62             ;LD xh,D
 instr  fetch_E,        op_nop,         store_xH        ;63             ;LD xh,E
-instr  fetch_nop,      op_nop,         store_nop       ;64             ;LD xh,xh
+instr  fetch_nop,      op_noni,        store_nop       ;64             ;LD xh,xh
 instr  fetch_xL,       op_nop,         store_xH        ;65             ;LD xh,xl
 instr  fetch_MXX,      op_nop,         store_H         ;66             ;LD H,(xx+d)
 instr  fetch_A,        op_nop,         store_xH        ;67             ;LD xh,A
@@ -3515,7 +3614,7 @@ instr     fetch_C,        op_nop,         store_xL        ;69             ;LD xl,C
 instr  fetch_D,        op_nop,         store_xL        ;6A             ;LD xl,D
 instr  fetch_E,        op_nop,         store_xL        ;6B             ;LD xl,E
 instr  fetch_xH,       op_nop,         store_xL        ;6C             ;LD xl,xh
-instr  fetch_nop,      op_nop,         store_nop       ;6D             ;LD xl,xl
+instr  fetch_nop,      op_noni,        store_nop       ;6D             ;LD xl,xl
 instr  fetch_MXX,      op_nop,         store_L         ;6E             ;LD L,(xx+d)
 instr  fetch_A,        op_nop,         store_xL        ;6F             ;LD xl,A
 instr  fetch_B,        op_nop,         store_MXX       ;70             ;LD (xx+d),B
@@ -3524,144 +3623,144 @@ instr         fetch_D,        op_nop,         store_MXX       ;72             ;LD (xx+d),D
 instr  fetch_E,        op_nop,         store_MXX       ;73             ;LD (xx+d),E
 instr  fetch_H,        op_nop,         store_MXX       ;74             ;LD (xx+d),H
 instr  fetch_L,        op_nop,         store_MXX       ;75             ;LD (xx+d),L
-instr  fetch_nop,      op_nop,         store_nop       ;76             ;
+instr  fetch_nop,      op_noni,        store_nop       ;76             ;
 instr  fetch_A,        op_nop,         store_MXX       ;77             ;LD (xx+d),A
-instr  fetch_nop,      op_nop,         store_nop       ;78             ;
-instr  fetch_nop,      op_nop,         store_nop       ;79             ;
-instr  fetch_nop,      op_nop,         store_nop       ;7A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;7B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;78             ;
+instr  fetch_nop,      op_noni,        store_nop       ;79             ;
+instr  fetch_nop,      op_noni,        store_nop       ;7A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;7B             ;
 instr  fetch_xH,       op_nop,         store_A         ;7C             ;LD A,xh
 instr  fetch_xL,       op_nop,         store_A         ;7D             ;LD A,xl
 instr  fetch_MXX,      op_nop,         store_A         ;7E             ;LD A,(xx+d)
-instr  fetch_nop,      op_nop,         store_nop       ;7F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;80             ;
-instr  fetch_nop,      op_nop,         store_nop       ;81             ;
-instr  fetch_nop,      op_nop,         store_nop       ;82             ;
-instr  fetch_nop,      op_nop,         store_nop       ;83             ;
+instr  fetch_nop,      op_noni,        store_nop       ;7F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;80             ;
+instr  fetch_nop,      op_noni,        store_nop       ;81             ;
+instr  fetch_nop,      op_noni,        store_nop       ;82             ;
+instr  fetch_nop,      op_noni,        store_nop       ;83             ;
 instr  fetch_xH,       op_ADDA,        store_nop       ;84             ;ADD A,xh
 instr  fetch_xL,       op_ADDA,        store_nop       ;85             ;ADD A,xl
 instr  fetch_MXX,      op_ADDA,        store_nop       ;86             ;ADD A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;87             ;
-instr  fetch_nop,      op_nop,         store_nop       ;88             ;
-instr  fetch_nop,      op_nop,         store_nop       ;89             ;
-instr  fetch_nop,      op_nop,         store_nop       ;8A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;8B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;87             ;
+instr  fetch_nop,      op_noni,        store_nop       ;88             ;
+instr  fetch_nop,      op_noni,        store_nop       ;89             ;
+instr  fetch_nop,      op_noni,        store_nop       ;8A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;8B             ;
 instr  fetch_xH,       op_ADCA,        store_nop       ;8C             ;ADC A,xh
 instr  fetch_xL,       op_ADCA,        store_nop       ;8D             ;ADC A,xl
 instr  fetch_MXX,      op_ADCA,        store_nop       ;8E             ;ADC A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;8F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;90             ;
-instr  fetch_nop,      op_nop,         store_nop       ;91             ;
-instr  fetch_nop,      op_nop,         store_nop       ;92             ;
-instr  fetch_nop,      op_nop,         store_nop       ;93             ;
+instr  fetch_nop,      op_noni,        store_nop       ;8F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;90             ;
+instr  fetch_nop,      op_noni,        store_nop       ;91             ;
+instr  fetch_nop,      op_noni,        store_nop       ;92             ;
+instr  fetch_nop,      op_noni,        store_nop       ;93             ;
 instr  fetch_xH,       op_SUBFA,       store_nop       ;94             ;SUB A,xh
 instr  fetch_xL,       op_SUBFA,       store_nop       ;95             ;SUB A,xl
 instr  fetch_MXX,      op_SUBFA,       store_nop       ;96             ;SUB A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;97             ;
-instr  fetch_nop,      op_nop,         store_nop       ;98             ;
-instr  fetch_nop,      op_nop,         store_nop       ;99             ;
-instr  fetch_nop,      op_nop,         store_nop       ;9A             ;
-instr  fetch_nop,      op_nop,         store_nop       ;9B             ;
+instr  fetch_nop,      op_noni,        store_nop       ;97             ;
+instr  fetch_nop,      op_noni,        store_nop       ;98             ;
+instr  fetch_nop,      op_noni,        store_nop       ;99             ;
+instr  fetch_nop,      op_noni,        store_nop       ;9A             ;
+instr  fetch_nop,      op_noni,        store_nop       ;9B             ;
 instr  fetch_xH,       op_SBCFA,       store_nop       ;9C             ;SBC A,xh
 instr  fetch_xL,       op_SBCFA,       store_nop       ;9D             ;SBC A,xl
 instr  fetch_MXX,      op_SBCFA,       store_nop       ;9E             ;SBC A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;9F             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A0             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A1             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A2             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A3             ;
+instr  fetch_nop,      op_noni,        store_nop       ;9F             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A1             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A3             ;
 instr  fetch_xH,       op_ANDA,        store_nop       ;A4             ;AND A,xh
 instr  fetch_xL,       op_ANDA,        store_nop       ;A5             ;AND A,xl
 instr  fetch_MXX,      op_ANDA,        store_nop       ;A6             ;AND A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;A7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A8             ;
-instr  fetch_nop,      op_nop,         store_nop       ;A9             ;
-instr  fetch_nop,      op_nop,         store_nop       ;AA             ;
-instr  fetch_nop,      op_nop,         store_nop       ;AB             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;A9             ;
+instr  fetch_nop,      op_noni,        store_nop       ;AA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;AB             ;
 instr  fetch_xH,       op_XORA,        store_nop       ;AC             ;XOR A,xh
 instr  fetch_xL,       op_XORA,        store_nop       ;AD             ;XOR A,xl
 instr  fetch_MXX,      op_XORA,        store_nop       ;AE             ;XOR A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;AF             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B0             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B1             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B2             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B3             ;
+instr  fetch_nop,      op_noni,        store_nop       ;AF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B1             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B3             ;
 instr  fetch_xH,       op_ORA,         store_nop       ;B4             ;OR A,xh
 instr  fetch_xL,       op_ORA,         store_nop       ;B5             ;OR A,xl
 instr  fetch_MXX,      op_ORA,         store_nop       ;B6             ;OR A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;B7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B8             ;
-instr  fetch_nop,      op_nop,         store_nop       ;B9             ;
-instr  fetch_nop,      op_nop,         store_nop       ;BA             ;
-instr  fetch_nop,      op_nop,         store_nop       ;BB             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;B9             ;
+instr  fetch_nop,      op_noni,        store_nop       ;BA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;BB             ;
 instr  fetch_xH,       op_CPFA,        store_nop       ;BC             ;CP A,xh
 instr  fetch_xL,       op_CPFA,        store_nop       ;BD             ;CP A,xl
 instr  fetch_MXX,      op_CPFA,        store_nop       ;BE             ;CP A,(xx)
-instr  fetch_nop,      op_nop,         store_nop       ;BF             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C0             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C1             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C2             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C3             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C4             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C5             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C6             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C8             ;
-instr  fetch_nop,      op_nop,         store_nop       ;C9             ;
-instr  fetch_nop,      op_nop,         store_nop       ;CA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;BF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C1             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C3             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C4             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C5             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C6             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;C9             ;
+instr  fetch_nop,      op_noni,        store_nop       ;CA             ;
 instr  fetch_nop,      op_prefixDDFDCB,store_nop       ;CB             ;
-instr  fetch_nop,      op_nop,         store_nop       ;CC             ;
-instr  fetch_nop,      op_nop,         store_nop       ;CD             ;
-instr  fetch_nop,      op_nop,         store_nop       ;CE             ;
-instr  fetch_nop,      op_nop,         store_nop       ;CF             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D0             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D1             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D2             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D3             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D4             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D5             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D6             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D8             ;
-instr  fetch_nop,      op_nop,         store_nop       ;D9             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DA             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DB             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DC             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DD             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DE             ;
-instr  fetch_nop,      op_nop,         store_nop       ;DF             ;
-instr  fetch_nop,      op_nop,         store_nop       ;E0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;CC             ;
+instr  fetch_nop,      op_noni,        store_nop       ;CD             ;
+instr  fetch_nop,      op_noni,        store_nop       ;CE             ;
+instr  fetch_nop,      op_noni,        store_nop       ;CF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D1             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D3             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D4             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D5             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D6             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;D9             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DB             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DC             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DD             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DE             ;
+instr  fetch_nop,      op_noni,        store_nop       ;DF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E0             ;
 instr  fetch_nop,      op_POP16,       store_xx        ;E1             ;POP xx
-instr  fetch_nop,      op_nop,         store_nop       ;E2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E2             ;
 instr  fetch_MSP,      op_EXxx,        store_MSP       ;E3             ;EX (SP),xx
-instr  fetch_nop,      op_nop,         store_nop       ;E4             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E4             ;
 instr  fetch_xx,       op_PUSH16,      store_nop       ;E5             ;PUSH xx
-instr  fetch_nop,      op_nop,         store_nop       ;E6             ;
-instr  fetch_nop,      op_nop,         store_nop       ;E7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;E8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E6             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;E8             ;
 instr  fetch_xx,       op_nop,         store_PC        ;E9             ;JP xx
-instr  fetch_nop,      op_nop,         store_nop       ;EA             ;
-instr  fetch_nop,      op_nop,         store_nop       ;EB             ;
-instr  fetch_nop,      op_nop,         store_nop       ;EC             ;
-instr  fetch_nop,      op_nop,         store_nop       ;ED             ;
-instr  fetch_nop,      op_nop,         store_nop       ;EE             ;
-instr  fetch_nop,      op_nop,         store_nop       ;EF             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F0             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F1             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F2             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F3             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F4             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F5             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F6             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F7             ;
-instr  fetch_nop,      op_nop,         store_nop       ;F8             ;
+instr  fetch_nop,      op_noni,        store_nop       ;EA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;EB             ;
+instr  fetch_nop,      op_noni,        store_nop       ;EC             ;
+instr  fetch_nop,      op_noni,        store_nop       ;ED             ;
+instr  fetch_nop,      op_noni,        store_nop       ;EE             ;
+instr  fetch_nop,      op_noni,        store_nop       ;EF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F0             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F1             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F2             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F3             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F4             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F5             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F6             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F7             ;
+instr  fetch_nop,      op_noni,        store_nop       ;F8             ;
 instr  fetch_xx,       op_nop,         store_SP        ;F9             ;LD SP,xx
-instr  fetch_nop,      op_nop,         store_nop       ;FA             ;
-instr  fetch_nop,      op_nop,         store_nop       ;FB             ;
-instr  fetch_nop,      op_nop,         store_nop       ;FC             ;
-instr  fetch_nop,      op_nop,         store_nop       ;FD             ;
-instr  fetch_nop,      op_nop,         store_nop       ;FE             ;
-instr  fetch_nop,      op_nop,         store_nop       ;FF             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FA             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FB             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FC             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FD             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FE             ;
+instr  fetch_nop,      op_noni,        store_nop       ;FF             ;
 
 
        opctable        CBjmp
@@ -3926,70 +4025,70 @@ instr   fetch_A,        op_SET7,        store_A         ;FF             ;SET 7,A
 
        opctable        DDFDCBjmp
 
-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_nop,      op_RLC,         store_B         ;00             ;RLC (Ix+d),B
+instr  fetch_nop,      op_RLC,         store_C         ;01             ;RLC (Ix+d),C
+instr  fetch_nop,      op_RLC,         store_D         ;02             ;RLC (Ix+d),D
+instr  fetch_nop,      op_RLC,         store_E         ;03             ;RLC (Ix+d),E
+instr  fetch_nop,      op_RLC,         store_H         ;04             ;RLC (Ix+d),H
+instr  fetch_nop,      op_RLC,         store_L         ;05             ;RLC (Ix+d),L
+instr  fetch_nop,      op_RLC,         store_nop       ;06             ;RLC (Ix+d)  
+instr  fetch_nop,      op_RLC,         store_A         ;07             ;RLC (Ix+d),A
+instr  fetch_nop,      op_RRC,         store_B         ;08             ;RRC (Ix+d),B
+instr  fetch_nop,      op_RRC,         store_C         ;09             ;RRC (Ix+d),C
+instr  fetch_nop,      op_RRC,         store_D         ;0A             ;RRC (Ix+d),D
+instr  fetch_nop,      op_RRC,         store_E         ;0B             ;RRC (Ix+d),E
+instr  fetch_nop,      op_RRC,         store_H         ;0C             ;RRC (Ix+d),H
+instr  fetch_nop,      op_RRC,         store_L         ;0D             ;RRC (Ix+d),L
+instr  fetch_nop,      op_RRC,         store_nop       ;0E             ;RRC (Ix+d)  
+instr  fetch_nop,      op_RRC,         store_A         ;0F             ;RRC (Ix+d),A
+instr  fetch_nop,      op_RL,          store_B         ;10             ;RL  (Ix+d),B
+instr  fetch_nop,      op_RL,          store_C         ;11             ;RL  (Ix+d),C
+instr  fetch_nop,      op_RL,          store_D         ;12             ;RL  (Ix+d),D
+instr  fetch_nop,      op_RL,          store_E         ;13             ;RL  (Ix+d),E
+instr  fetch_nop,      op_RL,          store_H         ;14             ;RL  (Ix+d),H
+instr  fetch_nop,      op_RL,          store_L         ;15             ;RL  (Ix+d),L
+instr  fetch_nop,      op_RL,          store_nop       ;16             ;RL  (Ix+d)  
+instr  fetch_nop,      op_RL,          store_A         ;17             ;RL  (Ix+d),A
+instr  fetch_nop,      op_RR,          store_B         ;18             ;RR  (Ix+d),B
+instr  fetch_nop,      op_RR,          store_C         ;19             ;RR  (Ix+d),C
+instr  fetch_nop,      op_RR,          store_D         ;1A             ;RR  (Ix+d),D
+instr  fetch_nop,      op_RR,          store_E         ;1B             ;RR  (Ix+d),E
+instr  fetch_nop,      op_RR,          store_H         ;1C             ;RR  (Ix+d),H
+instr  fetch_nop,      op_RR,          store_L         ;1D             ;RR  (Ix+d),L
+instr  fetch_nop,      op_RR,          store_nop       ;1E             ;RR  (Ix+d)  
+instr  fetch_nop,      op_RR,          store_A         ;1F             ;RR  (Ix+d),A
+instr  fetch_nop,      op_SLA,         store_B         ;20             ;SLA (Ix+d),B
+instr  fetch_nop,      op_SLA,         store_C         ;21             ;SLA (Ix+d),C
+instr  fetch_nop,      op_SLA,         store_D         ;22             ;SLA (Ix+d),D
+instr  fetch_nop,      op_SLA,         store_E         ;23             ;SLA (Ix+d),E
+instr  fetch_nop,      op_SLA,         store_H         ;24             ;SLA (Ix+d),H
+instr  fetch_nop,      op_SLA,         store_L         ;25             ;SLA (Ix+d),L
+instr  fetch_nop,      op_SLA,         store_nop       ;26             ;SLA (Ix+d)  
+instr  fetch_nop,      op_SLA,         store_A         ;27             ;SLA (Ix+d),A
+instr  fetch_nop,      op_SRA,         store_B         ;28             ;SRA (Ix+d),B
+instr  fetch_nop,      op_SRA,         store_C         ;29             ;SRA (Ix+d),C
+instr  fetch_nop,      op_SRA,         store_D         ;2A             ;SRA (Ix+d),D
+instr  fetch_nop,      op_SRA,         store_E         ;2B             ;SRA (Ix+d),E
+instr  fetch_nop,      op_SRA,         store_H         ;2C             ;SRA (Ix+d),H
+instr  fetch_nop,      op_SRA,         store_L         ;2D             ;SRA (Ix+d),L
+instr  fetch_nop,      op_SRA,         store_nop       ;2E             ;SRA (Ix+d)  
+instr  fetch_nop,      op_SRA,         store_A         ;2F             ;SRA (Ix+d),A
+instr  fetch_nop,      op_SLL,         store_B         ;30             ;SLL (Ix+d),B
+instr  fetch_nop,      op_SLL,         store_C         ;31             ;SLL (Ix+d),C
+instr  fetch_nop,      op_SLL,         store_D         ;32             ;SLL (Ix+d),D
+instr  fetch_nop,      op_SLL,         store_E         ;33             ;SLL (Ix+d),E
+instr  fetch_nop,      op_SLL,         store_H         ;34             ;SLL (Ix+d),H
+instr  fetch_nop,      op_SLL,         store_L         ;35             ;SLL (Ix+d),L
+instr  fetch_nop,      op_SLL,         store_nop       ;36             ;SLL (Ix+d)  
+instr  fetch_nop,      op_SLL,         store_A         ;37             ;SLL (Ix+d),A
+instr  fetch_nop,      op_SRL,         store_B         ;38             ;SRL (Ix+d),B
+instr  fetch_nop,      op_SRL,         store_C         ;39             ;SRL (Ix+d),C
+instr  fetch_nop,      op_SRL,         store_D         ;3A             ;SRL (Ix+d),D
+instr  fetch_nop,      op_SRL,         store_E         ;3B             ;SRL (Ix+d),E
+instr  fetch_nop,      op_SRL,         store_H         ;3C             ;SRL (Ix+d),H
+instr  fetch_nop,      op_SRL,         store_L         ;3D             ;SRL (Ix+d),L
+instr  fetch_nop,      op_SRL,         store_nop       ;3E             ;SRL (Ix+d)  
+instr  fetch_nop,      op_SRL,         store_A         ;3F             ;SRL (Ix+d),A
 instr  fetch_nop,      op_BIT0,        store_nop       ;40             ;BIT 0,(Ix+d),B
 instr  fetch_nop,      op_BIT0,        store_nop       ;41             ;BIT 0,(Ix+d),C
 instr  fetch_nop,      op_BIT0,        store_nop       ;42             ;BIT 0,(Ix+d),D
index af62efd41408e3aa35d5688022cc818cc9f6d070..155c0274130b7c331a1a48adb37b0fa63c339fe8 100644 (file)
@@ -205,8 +205,6 @@ printstr_end:
 ; --------------- Debugging stuff ---------------
 ; Print a line with the 8080/Z80 registers
 
-; TODO: y:
-
 printregs:
        mov     temp,z_flags
        rcall   printflags
@@ -233,33 +231,31 @@ printregs:
        rcall   printhexw
        printstring "       "
        movw    xl,z_pcl
-       mem_read
+       lcall   dram_read_pp
        rcall   printhex
        printstring " "
-       adiw    x,1
-       mem_read
+       lcall   dram_read_pp
        rcall   printhex
        printstring " "
-       adiw    x,1
-       mem_read
+       lcall   dram_read
        rcall   printhex
        printstring " "
 
 #if EM_Z80
        ldd     temp,y+oz_f2
        rcall   printflags
-       printstring "  A'="
+       printstring "  a'="
        ldd     temp,y+oz_a2
        rcall   printhex        
-       printstring " BC'="
+       printstring " bc'="
        ldd     temp2,y+oz_b2
        ldd     temp,y+oz_c2
        rcall   printhexw
-       printstring " DE'="
+       printstring " de'="
        ldd     temp2,y+oz_d2
        ldd     temp,y+oz_e2
        rcall   printhexw
-       printstring " HL'="
+       printstring " hl'="
        ldd     temp2,y+oz_h2
        ldd     temp,y+oz_l2
        rcall   printhexw