home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
zcat
/
sysiop21.lbr
/
HD64180.MZB
/
HD64180.MLB
Wrap
Text File
|
1991-01-31
|
6KB
|
253 lines
;+
; Edit Version 1.10
;**************************************************************************
;*** Hitachi HD64180 macro library. ***
;**************************************************************************
;
; File Name : HD64180.MLB
; Author : Edmund Cramp
; Creation Date : 23-Dec-1985
;
; Proccesor Type : Hitachi HD64180
; Assembler Name : Z80ASM (SLR systems)
;
; Ammendment Record
; *****************
; Name Date Details of Ammendment
; ------------ ----------- ---------------------
; Edmund Cramp 23-Dec-1985 Initial Creation.
; Edmund Cramp 25-Dec-1985 Instruction documentation added.
; Edmund Cramp 14-Jan-1986 File extension changed (MacroLiBrary).
;
; Module Function
; ***************
; Support the Hitachi HD64180 processor with the SLR system assembler
; since there are no other assemblers that have the speed or functionality.
;-
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+++ CPU Control +++
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+
; SLEEP.
; The SLP instruction causes the HD64180 to enter SLEEP low power
; consumption mode. See the Hitachi Data Manual.
;-
SLP MACRO ; Enter SLEEP mode.
DEFB 0EDH,076H
ENDM
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+++ Arithmetic Instructions. +++
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+
; MULTIPLY.
; The MLT performs unsigned multiplication on two 8 bit numbers yielding
; a 16 bit result. MLT may specify BC, DE, HL or SP registers to recieve the
; 16-bit result.
;-
MLT MACRO P1 ; 8 bit multiply with 16 bit result.
IFIDN <P1>,<BC>
DEFB 0EDH,04CH
EXITM
ENDIF
IFIDN <P1>,<DE>
DEFB 0EDH,05CH
EXITM
ENDIF
IFIDN <P1>,<HL>
DEFB 0EDH,06CH
EXITM
ENDIF
IFIDN <P1>,<SP>
DEFB 0EDH,07CH
EXITM
ENDIF
.PRINTX "NO PARAMETER - HD64180 - MLT"
DEFB 00,00
ENDM
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+++ Input/Output. +++
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+
; INPUT, IMMEDIATE I/O ADDRESS.
; The contents of the specified register are output to the immediately
; specified 8-bit I/O address. When I/O is accessed, 00H is output in the
; high-order bits of the address automatically.
;-
IN0 MACRO P1,P2 ; Input from immediate I/O to register.
IFIDN <P1>,<B>
DEFB 0EDH,00H,P2
EXITM
ENDIF
IFIDN <P1>,<C>
DEFB 0EDH,08H,P2
EXITM
ENDIF
IFIDN <P1>,<D>
DEFB 0EDH,10H,P2
EXITM
ENDIF
IFIDN <P1>,<E>
DEFB 0EDH,18H,P2
EXITM
ENDIF
IFIDN <P1>,<H>
DEFB 0EDH,20H,P2
EXITM
ENDIF
IFIDN <P1>,<L>
DEFB 0EDH,28H,P2
EXITM
ENDIF
IFIDN <P1>,<A>
DEFB 0EDH,38H,P2
EXITM
ENDIF
.PRINTX "ERROR - HD64180 IN0"
DEFB 00,00,00
ENDM
;+
; OUTPUT, IMMEDIATE I/O ADDRESS.
; The contents of the specified register are output to the immediately
; specified 8-bit I/O address. When I/O is accessed, 00H is output in the
; high-order bits of the address automatically.
;-
OUT0 MACRO P1,P2 ; Output register to immediate I/O address.
IFIDN <P2>,<B>
DEFB 0EDH,01H,P1
EXITM
ENDIF
IFIDN <P2>,<C>
DEFB 0EDH,09H,P1
EXITM
ENDIF
IFIDN <P2>,<D>
DEFB 0EDH,11H,P1
EXITM
ENDIF
IFIDN <P2>,<E>
DEFB 0EDH,19H,P1
EXITM
ENDIF
IFIDN <P2>,<H>
DEFB 0EDH,20H,P1
EXITM
ENDIF
IFIDN <P2>,<L>
DEFB 0EDH,29H,P1
EXITM
ENDIF
IFIDN <P2>,<A>
DEFB 0EDH,39H,P1
EXITM
ENDIF
.PRINTX "ERROR - MISSING HD64180 PARAMETER - OUT0"
DEFB 00,00,00
ENDM
;+
; OTIM, OTIMR, OTDM, OTDMR:- BLOCK I/O.
; The contents of memory pointed to by HL is output to the I/O address
; in (C). The memory address (HL) and the I/O address (C) are incremented
; in OTIM and OTIMR and decremented in OTDM and OTDMR respectivly. The B
; register is decremented. The OTIMR and OTDMR variants repeat the above
; sequence until register B is decremented to 0. Since the I/O address (C)
; is automatically incremented or decremented, these instructions are useful
; for block I/O (such as the HD64180 on-chip I/O) initialisation. When I/O
; is accessed, 00h is output in the high-order bits of the address
; automatically.
;-
OTIM MACRO
DEFB 0EDH,83H
ENDM
OTIMR MACRO
DEFB 0EDH,93H
ENDM
OTDM MACRO
DEFB 0EDH,8BH
ENDM
OTDMR MACRO
DEFB 0EDH,9BH
ENDM
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+++ Test +++
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;+
; TEST I/O PORT.
; The contents of the I/O port addressed by C are ANDed with the
; immediately specified 8-bit data and the status flags are updated. The
; I/O port contents are not written (non-destructive AND). When I/O is
; accessed, 00H is output in the higher bits of the address automatically.
; This is an improvement on the obscure ZILOG instruction "IN AF,(C).
;-
TSTIO MACRO P1 ; I/O AND immediate
IFNDEF P1
.PRINTX "ERROR HD64180 TSTIO PARAMETER"
ELSE
DEFB 0EDH,74H,P1
ENDIF
ENDM
;+
; TEST REGISTER.
; The contents of the specified register are ANDed with the accumulator
; (A) and the status flags updated. The accumulator and specified register
; are not changed (non-destructive AND).
; TEST IMMEDIATE.
; The contents of the immediately specified 8-bit data are ANDed with
; the accumulator (A) and the status flags updated. The accumulator is not
; changed (non-destructive AND).
; TEST MEMORY.
; The contents of memory pointed to by HL are ANDed with the accumulator
; (A) and the status flags updated. The memory contents and the accumulator
; are not changed (non-destructive AND).
;-
TST MACRO P1 ; Acc AND target (non-destructive)
IFIDN <P1>,<B>
DEFB 0EDH,04H
EXITM
ENDIF
IFIDN <P1>,<C>
DEFB 0EDH,0CH
EXITM
ENDIF
IFIDN <P1>,<D>
DEFB 0EDH,14H
EXITM
ENDIF
IFIDN <P1>,<E>
DEFB 0EDH,1CH
EXITM
ENDIF
IFIDN <P1>,<H>
DEFB 0EDH,24H
EXITM
ENDIF
IFIDN <P1>,<L>
DEFB 0EDH,2CH
EXITM
ENDIF
IFIDN <P1>,<A> ;; TST A
DEFB 0EDH,3CH
EXITM
ENDIF
IFIDN <P1>,<(HL)> ;; TST (HL)
DEFB 0EDH,34H
EXITM
ENDIF
;; Should be TST byte.
DEFB 0EDH,64H,P1
ENDM