home *** CD-ROM | disk | FTP | other *** search
- .COMMENT *
- LIBRARY CPMZ80.LIB
-
- This file contains the various CP/M and H-89 equates
- and definitions used for the MACRO-80 assembler and CP/M.
-
- NOTE: Some of the equates in this file are not used by the current
- program. This file is generic in nature, in that a number of
- different programs use different portions of it.
- *
- .Z80 ;Always program in Z-80 code
- ;-----------------------------------------
- ; BDOS call vector commands
- ;-----------------------------------------
- CONIN EQU 01H ;BDOS Console Input
- CONOUT EQU 02H ;BDOS Console Output
- AUXIN EQU 03H ;BDOS Auxiliary Input
- AUXOUT EQU 04H ;BDOS Auxiliary Output
- LSTOUT EQU 05H ;BDOS write to LST device
- DCONIO EQU 06H ;BDOS Direct Console I/O
- AUXNST EQU 07H ;BDOS Auxiliary Input Status
- AUXOST EQU 08H ;BDOS Auxiliary Output Status
- PRTSTR EQU 09H ;BDOS Print String
- RDCONB EQU 0AH ;BDOS Read Console Buffer
- GCONST EQU 0BH ;BDOS Get Console Status
- RETVER EQU 0CH ;BDOS Return Version Number
- RESDSK EQU 0DH ;BDOS Reset Disk System
- SELDSK EQU 0EH ;BDOS Select Disk
- FOPEN EQU 0FH ;BDOS File Open
- FCLOSE EQU 10H ;BDOS File Close
- SRCH1 EQU 11H ;BDOS Search For First
- SRCHN EQU 12H ;BDOS Search For Next
- DELFL EQU 13H ;BDOS Delete File
- FREAD EQU 14H ;BDOS File Read
- FWRITE EQU 15H ;BDOS File Write
- MAKEFL EQU 16H ;BDOS Make New File
- RENMFL EQU 17H ;BDOS Rename File
- RETLOG EQU 18H ;BDOS Return Login Vector
- CURDSK EQU 19H ;BDOS Find Default Drive
- SETDMA EQU 1AH ;BDOS Set DMA Address
- GETADD EQU 1BH ;BDOS Get Allocation Address
- WRPROT EQU 1CH ;BDOS Write Protect Disk
- GTRDVC EQU 1DH ;BDOS Get Read-Only Vector
- SETFIL EQU 1EH ;BDOS Set File Attributes
- GETDPB EQU 1FH ;BDOS Get DPB Parameters Address
- USRSET EQU 20H ;BDOS Set User Number
- RDFRND EQU 21H ;BDOS Read File Random
- WTFRND EQU 22H ;BDOS Write File Random
- COMPFL EQU 23H ;BDOS Compute File Size
- SETRND EQU 24H ;BDOS Set random record number
- ;-----------------------------------------
- ; Analytical Products speed mod port info
- ;-----------------------------------------
- CPORT EQU 0F2H ;General Purpose Port address
- CBIT EQU 00001000B ;Mask for Clock Speed 2/4 Mhz
- ;-----------------------------------------
- ; ASCII character equates
- ;-----------------------------------------
- NULL EQU 00H
- SOH EQU 01H
- STX EQU 02H
- ETX EQU 03H
- EOT EQU 04H
- ENQ EQU 05H
- ACK EQU 06H
- BELL EQU 07H
- BS EQU 08H
- TAB EQU 09H
- LF EQU 0AH
- NL EQU LF
- VT EQU 0BH
- FF EQU 0CH
- CR EQU 0DH
- SO EQU 0EH
- SI EQU 0FH
- DLE EQU 10H
- DC1 EQU 11H
- DC2 EQU 12H
- DC3 EQU 13H
- DC4 EQU 14H
- NAK EQU 15H
- SYN EQU 16H
- ETB EQU 17H
- CAN EQU 18H
- EM EQU 19H
- SUB EQU 1AH
- ESC EQU 1BH
- FS EQU 1CH
- GS EQU 1DH
- RS EQU 1EH
- US EQU 1FH
- SPC EQU 20H
- DELETE EQU 7FH
- ENL EQU NL+80H
- ;-----------------------------------------
- ; Control Character Equates
- ;-----------------------------------------
- ctrlc equ 3
- ctrld equ 4
- ctrlf equ 6
- ctrlm equ 13
- ctrlp equ 16
- ctrlq equ 17
- ctrlr equ 18
- ;-----------------------------------------
- ; H-89 Keyboard equates
- ;-----------------------------------------
- ERASE EQU 74
- BLU EQU 80
- RED EQU 81
- WHT EQU 82
- FUNC1 EQU 83
- FUNC2 EQU 84
- FUNC3 EQU 85
- FUNC4 EQU 86
- FUNC5 EQU 87
- ;-----------------------------------------
- ; Printer port addresses and equates
- ; for the Z-89-11 Multi-Mode I/O Board
- ;-----------------------------------------
- PBASE EQU 340Q
- STB.ON EQU 00
- STB.OF EQU 01
- PDA EQU PBASE+0
- PDC EQU PBASE+2
- PCTL EQU PBASE+3
- ;-----------------------------------------
- ; Analytical Products
- ; Real Time Clock port equates
- ;-----------------------------------------
- RTCBAS EQU 80H ;RTC port base address
- RTCSEC EQU RTCBAS+2 ;Seconds port
- RTCMIN EQU RTCBAS+3 ;Minutes port
- RTCHOR EQU RTCBAS+4 ;Hour port
- RTCDWK EQU RTCBAS+5 ;Day of Week port (1=Mon 7=Sun)
- RTCDAY EQU RTCBAS+6 ;Day port
- RTCMON EQU RTCBAS+7 ;Month port
- RTCYER EQU RTCBAS+9 ;Year port
- ;-----------------------------------------
- ; 8250 UART control and bit definitions
- ;-----------------------------------------
- B8250.1 EQU 0D0H
- B8250.2 EQU 0D8H
- B8250.3 EQU 0E0H
- RBR EQU 0 ;Reciever Buffer Register
- THR EQU 0 ;Transmitter Holding Register
- DLL EQU 0 ;Divisor Latch Address (LSB)
- DLM EQU 1 ;Divisor Latch Address (MSB)
- INTER EQU 1 ;Interrupt Enable Register
- INTIR EQU 2 ;Interrupt ID Register
- LINCR EQU 3 ;Line Control Register
- MODCR EQU 4 ;Modem Control Register
- LINSR EQU 5 ;Line Status Register
- MODSR EQU 6 ;Modem Status Register
- UCLOO EQU 00010000B ;Enable Loop-Back
- RTSDTR EQU 00000011B ;RTS + DTR bits
- UCDLA EQU 10000000B ;Order Divisor Latch Access
- ;-----------------------------------------
- ; 2661 EPCI control and bit definitions
- ;-----------------------------------------
- b2661 equ 0d8h ;Port base address for 2661 EPCI
- epdat equ 0 ;Data register (Read / Write)
- epsr equ 1 ;Status register (Read)
- epmr1 equ 2 ;Mode register 1 (Write)
- epmr2 equ 2 ;Mode register 2 (Write)
- epcr equ 3 ;Command register (Read / Write)
- ep.int equ 4 ;Interrupt port
- epcmd equ 00110111b ;Normal operating command (37H)
- mr1.nml equ 01001110b ;Mode register 1 normal (4EH)
- mr2.05 equ 01110000b ;Mode register 2 - 50 baud (70H)
- mr2.11 equ 01110010b ;Mode register 2 - 110 baud (72H)
- mr2.3 equ 01110101b ;Mode register 2 - 300 baud (75H)
- mr2.6 equ 01110110b ;mode register 2 - 600 baud (76H)
- mr2.12 equ 01110111b ;Mode register 2 - 1200 baud (77H)
- mr2.24 equ 01111010b ;Mode register 2 - 2400 baud (7AH)
- mr2.48 equ 01111100b ;Mode register 2 - 4800 baud (7CH)
- mr2.96 equ 01111110b ;Mode register 2 - 9600 baud (7EH)
- mr2.192 equ 01111111b ;Mode register 2 - 19200 baud (7FH)
- ;-----------------------------------------
- ; Misc CP/M and H-89 equates
- ;-----------------------------------------
- BDOS05 EQU 0005H ;BDOS entry CALL vector address
- TOPUSR EQU 0006H ;Top of user memory (BDOS base)
- TICCNT EQU 000BH ;CP/M 2 mSec clock byte
- CBYTE EQU 000DH ;CP/M control byte
- INTLV5 EQU 0028H ;Level 5 interrupt vector
- TPDRV EQU 0050H ;Drive TPA was loaded from
- FCB EQU 005CH ;BDOS File Control Block Address
- IOBUFF EQU 0080H ;BDOS DMA I/O Buffer Address
- TIC.SC2 EQU 500 ;500 tics of the 2mSec clock/second