OpenCores
URL https://opencores.org/ocsvn/z80control/z80control/trunk

Subversion Repositories z80control

[/] [z80control/] [trunk/] [DE1/] [ROM/] [z80.lib] - Rev 12

Compare with Previous | Blame | View Log

;       @CHK MACRO USED FOR CHECKING 8 BIT DISPLACMENTS
;
@CHK    MACRO   ?DD     ; USED FOR CHECKING RANGE OF 8-BIT DISP.S
        IF (?DD GT 7FH) AND (?DD LT 0FF80H)
 'DISPLACEMENT RANGE ERROR - Z80 LIB'
        ENDIF
        ENDM
LDX     MACRO   ?R,?D
        @CHK    ?D
        DB      0DDH,?R*8+46H,?D ;LDX
        ENDM
LDY     MACRO   ?R,?D
        @CHK    ?D
        DB      0FDH,?R*8+46H,?D ;LDY
        ENDM
STX     MACRO   ?R,?D
        @CHK    ?D
        DB      0DDH,70H+?R,?D ;STX
        ENDM
STY     MACRO   ?R,?D
        @CHK    ?D
        DB      0FDH,70H+?R,?D ;STY
        ENDM
;
;MVIX    MACRO   ?N,?D
;        @CHK    ?D
;        DB      0DDH,36H,?D,?N ;MVIX
;        ENDM
;MVIY    MACRO   ?N,?D
;        @CHK    ?D
;        DB      0FDH,36H,?D,?N ;MVIY
;        ENDM

LDAI    MACRO
        DB      0EDH,57H ;LDAI
        ENDM
LDAR    MACRO
        DB      0EDH,5FH ;LDAR
        ENDM
STAI    MACRO
        DB      0EDH,47H ;STAI
        ENDM
STAR    MACRO
        DB      0EDH,4FH ;STAR
        ENDM

LXIX    MACRO   ?NNNN
        DB      0DDH,21H ;LXIX
        DW      ?NNNN
        ENDM
LXIY    MACRO   ?NNNN
        DB      0FDH,21H ;LXIY
        DW      ?NNNN
        ENDM
LDED    MACRO   ?NNNN
        DB      0EDH,5BH ;LDED
        DW      ?NNNN
        ENDM
LBCD    MACRO   ?NNNN
        DB      0EDH,4BH ;LBCD
        DW      ?NNNN
        ENDM
;
;LSPD    MACRO   ?NNNN
;        DB      0EDH,07BH ;LSPD
;        DW      ?NNNN
;        ENDM
;LIXD    MACRO   ?NNNN
;        DB      0DDH,2AH ;LIXD
;        DW      ?NNNN
;        ENDM
;
;LIYD    MACRO   ?NNNN
;        DB      0FDH,2AH ;LIYD
;        DW      ?NNNN
;        ENDM
;
SBCD    MACRO   ?NNNN
        DB      0EDH,43H ;SBCD
        DW      ?NNNN
        ENDM
SDED    MACRO   ?NNNN
        DB      0EDH,53H ;SDED
        DW      ?NNNN
        ENDM
;
;SSPD    MACRO   ?NNNN
;        DB      0EDH,73H ;SSPD
;        DW      ?NNNN
;        ENDM
;SIXD    MACRO   ?NNNN
;        DB      0DDH,22H ;SIXD
;        DW      ?NNNN
;        ENDM
;SIYD    MACRO   ?NNNN
;        DB      0FDH,22H ;SIYD
;        DW      ?NNNN
;        ENDM
;SPIX    MACRO
;        DB      0DDH,0F9H ;SPIX
;        ENDM
;SPIY    MACRO
;        DB      0FDH,0F9H ;SPIY
;        ENDM
;
PUSHIX  MACRO
        DB      0DDH,0E5H ;PUSHIX
        ENDM
PUSHIY  MACRO
        DB      0FDH,0E5H ;PUSHIY
        ENDM
POPIX   MACRO
        DB      0DDH,0E1H ;POPIX
        ENDM
POPIY   MACRO
        DB      0FDH,0E1H ;POPIY
        ENDM
EXAF    MACRO
        DB      08H ;EXAF
        ENDM
EXX     MACRO
        DB      0D9H ;EXX
        ENDM
;
;XTIX    MACRO
;        DB      0DDH,0E3H ;XTIX
;        ENDM
;XTIY    MACRO
;        DB      0FDH,0E3H ;XTIY
;        ENDM
;
LDI     MACRO
        DB      0EDH,0A0H ;LDI
        ENDM
LDIR    MACRO
        DB      0EDH,0B0H ;LDIR
        ENDM
LDD     MACRO
        DB      0EDH,0A8H ;LDD
        ENDM
LDDR    MACRO
        DB      0EDH,0B8H ;LDDR
        ENDM
CCI     MACRO
        DB      0EDH,0A1H ;CCI
        ENDM
CCIR    MACRO
        DB      0EDH,0B1H ;CCIR
        ENDM
CCD     MACRO
        DB      0EDH,0A9H ;CCD
        ENDM
CCDR    MACRO
        DB      0EDH,0B9H ;CCDR
        ENDM
;
;ADDX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,86H,?D ;ADDX
;        ENDM
;ADDY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,86H,?D ;ADDY
;        ENDM
;ADCX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,8EH,?D ;ADCX
;        ENDM
;ADCY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,8EH,?D ;ADCY
;        ENDM
;SUBX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,96H,?D ;SUBX
;        ENDM
;SUBY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,96H,?D ;SUBY
;        ENDM
;SBCX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,9EH,?D ;SBCX
;        ENDM
;SBCY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,9EH,?D ;SBCY
;        ENDM
;ANDX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,0A6H,?D ;ANDX
;        ENDM
;ANDY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,0A6H,?D ;ANDY
;        ENDM
;XORX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,0AEH,?D ;XORX
;        ENDM
;XORY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,0AEH,?D ;XORY
;        ENDM
;ORX     MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,0B6H,?D ;ORX
;        ENDM
;ORY     MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,0B6H,?D ;ORY
;        ENDM
;CMPX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,0BEH,?D ;CMPX
;        ENDM
;CMPY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,0BEH,?D CMPY
;        ENDM
;INRX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,34H,?D ;INRX
;        ENDM
;INRY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,34H,?D ;INRY
;        ENDM
;DCRX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH,035H,?D ;DCRX
;        ENDM
;DCRY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH,35H,?D ;DCRY
;        ENDM
;
NEG     MACRO
        DB      0EDH,44H ;NEG
        ENDM
IM0     MACRO
        DB      0EDH,46H ;IM0
        ENDM
IM1     MACRO
        DB      0EDH,56H ;IM1
        ENDM
IM2     MACRO
        DB      0EDH,5EH ;
        ENDM
;
BC      EQU     0
DE      EQU     2
HL      EQU     4
IX      EQU     4       
IY      EQU     4
;
DADC    MACRO   ?R
        DB      0EDH,?R*8+4AH ;DADC
        ENDM
DSBC    MACRO   ?R
        DB      0EDH,?R*8+42H ;DSBC
        ENDM
;
;DADX    MACRO   ?R
;        DB      0DDH,?R*8+09H ;DADX
;        ENDM
;DADY    MACRO   ?R
;        DB      0FDH,?R*8+09H ;DADY
;        ENDM
;
INXIX   MACRO
        DB      0DDH,23H ;INXIX
        ENDM
INXIY   MACRO
        DB      0FDH,23H ;INXIY
        ENDM
DCXIX   MACRO
        DB      0DDH,2BH ;DCXIX
        ENDM
DCXIY   MACRO
        DB      0FDH,2BH ;DCXIY
        ENDM

BIT     MACRO   ?N,?R
        DB      0CBH,?N*8+?R+40H ;BIT
        ENDM
SETB    MACRO   ?N,?R
        DB      0CBH,?N*8+?R+0C0H ;SETB
        ENDM
RESB    MACRO   ?N,?R
        DB      0CBH,?N*8+?R+80H ;RESB
        ENDM

BITH    MACRO   ?N
        DB      0CBH,?N*8+46H ;BITH
        ENDM
BITX    MACRO   ?N,?D
        @CHK    ?D
        DB      0DDH,0CBH,?D,?N*8+46H ;BITX
        ENDM
BITY    MACRO   ?N,?D
        @CHK    ?D
        DB      0FDH,0CBH,?D,?N*8+46H ;BITY
        ENDM
SETH    MACRO   ?N
        DB      0CBH,?N*8+0C6H ;SETH
        ENDM
SETX    MACRO   ?N,?D
        @CHK    ?D
        DB      0DDH,0CBH,?D,?N*8+0C6H ;SETX
        ENDM
SETY    MACRO   ?N,?D
        @CHK    ?D
        DB      0FDH,0CBH,?D,?N*8+0C6H ;SETY
        ENDM
RESH    MACRO   ?N
        DB      0CBH,?N*8+86H ;RESH
        ENDM
RESX    MACRO   ?N,?D
        @CHK    ?D
        DB      0DDH,0CBH,?D,?N*8+86H ;RESX
        ENDM
RESY    MACRO   ?N,?D
        @CHK    ?D
        DB      0FDH,0CBH,?D,?N*8+86H ;RESY
        ENDM

JR      MACRO   ?N
        DB      18H,?N-$-1 ;JR
        ENDM
JRC     MACRO   ?N
        DB      38H,?N-$-1 ;JRC
        ENDM
JRNC    MACRO   ?N
        DB      30H,?N-$-1 ;JRNC
        ENDM
JRZ     MACRO   ?N
        DB      28H,?N-$-1 ;JRZ
        ENDM
JRNZ    MACRO   ?N
        DB      20H,?N-$-1 ;JRNZ
        ENDM
DJNZ    MACRO   ?N
        DB      10H,?N-$-1 ;DJNZ
        ENDM
;
;PCIX    MACRO
;        DB      0DDH,0E9H ;PCIX
;        ENDM
;PCIY    MACRO
;        DB      0FDH,0E9H ;PCIY
;        ENDM
;
RETI    MACRO
        DB      0EDH,4DH ;RETI
        ENDM
RETN    MACRO
        DB      0EDH,45H ;RETN
        ENDM

INP     MACRO   ?R
        DB      0EDH,?R*8+40H ;INP
        ENDM
OUTP    MACRO   ?R
        DB      0EDH,?R*8+41H ;OUTP
        ENDM
INI     MACRO
        DB      0EDH,0A2H ;INI
        ENDM
INIR    MACRO
        DB      0EDH,0B2H ;INIR
        ENDM
IND     MACRO
        DB      0EDH,0AAH ;IND
        ENDM
INDR    MACRO
        DB      0EDH,0BAH ;INDR
        ENDM
OUTI    MACRO
        DB      0EDH,0A3H ;OUTI
        ENDM
OUTIR   MACRO
        DB      0EDH,0B3H ;OUTIR
        ENDM
OUTD    MACRO
        DB      0EDH,0ABH ;OUTD
        ENDM
OUTDR   MACRO
        DB      0EDH,0BBH ;OUTDR
        ENDM
;
;RLCR    MACRO   ?R
;        DB      0CBH, 00H + ?R ;RLCR
;        ENDM
;RLCX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 06H ;RLCX
;        ENDM
;RLCY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 06H ;RLCY
;        ENDM
;RALR    MACRO   ?R
;        DB      0CBH, 10H+?R ;RALR
;        ENDM
;RALX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 16H ;RALX
;        ENDM
;RALY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 16H ;RALY
;        ENDM
;RRCR    MACRO   ?R
;        DB      0CBH, 08H + ?R ;RRCR
;        ENDM
;RRCX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 0EH ;RRCX
;        ENDM
;RRCY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 0EH ;RRCY
;        ENDM
;RARR    MACRO   ?R
;        DB      0CBH, 18H + ?R ;RARR
;        ENDM
;RARX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 1EH ;RARX
;        ENDM
;RARY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 1EH ;RARY
;        ENDM
;SLAR    MACRO   ?R
;        DB      0CBH, 20H + ?R ;SLAR
;        ENDM
;SLAX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 26H ;SLAX
;        ENDM
;SLAY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 26H ;SLAY
;        ENDM
;SRAR    MACRO   ?R
;        DB      0CBH, 28H+?R ;SRAR
;        ENDM
;SRAX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 2EH ;SRAX
;        ENDM
;SRAY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 2EH ;SRAY
;        ENDM
;SRLR    MACRO   ?R
;        DB      0CBH, 38H + ?R ;SRLR
;        ENDM
;SRLX    MACRO   ?D
;        @CHK    ?D
;        DB      0DDH, 0CBH, ?D, 3EH ;SRLX
;        ENDM
;SRLY    MACRO   ?D
;        @CHK    ?D
;        DB      0FDH, 0CBH, ?D, 3EH ;SRLY
;        ENDM
;RLD     MACRO
;        DB      0EDH, 6FH ;RLD
;        ENDM
RRD     MACRO
        DB      0EDH, 67H ;RRD
        ENDM


Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.