home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
zcat
/
sysiop21.lbr
/
RELIOP.ZZ0
/
RELIOP.Z80
Wrap
Text File
|
1991-01-31
|
6KB
|
185 lines
; Edit Version 1.00
;**************************************************************************
;**************************************************************************
;*** ***
;*** Dummy IOP for MicroMint SB-180 bios. ***
;*** ***
;**************************************************************************
;**************************************************************************
;
; File Name : RELIOP.Z80
; Author : Edmund Cramp
; Creation Date : 29-Dec-1985
;
; Proccessor Type : HD64180
; Assembler Name : Z80ASM (S.L.R Systems)
;
; Ammendment Record
; *****************
; Name Date Details of Ammendment
; ---- ---- ---------------------
; Edmund Cramp 29-Dec-1985 Initial Creation.
;
; Module Function.
; ****************
; This is a minimal IOP to provide I/O for the CONSOLE device only.
; It is written in relocatable code and uses polled I/O - you will need to
; modify the ASCI1 entry for STAT1 in the bios IOTABLE to DISABLE interrupts
; when the system is cold booted (see below).
; This module is to be loaded into the IOP partition when the system
; is first cold booted and should be replaced by a compatible IOP via LDR
; or BLDR in the system startup alias.
;
;**************************************************************************
; ==============
; External Files
; ==============
MACLIB HD64180.MLB ; HD64180 macro library
MACLIB PORTS.LIB ; SB-180 hardware definitions.
; =============
; Local Equates
; =============
TDRE EQU 00000010B ; Transmit data register empty
RDRF EQU 10000000B ; Receive data register full
;**************************************************************************
;*** Changes to standard bios routines ***
;**************************************************************************
;+
; ...in IOTABLE...
; DEFB 00000100B ; STAT1 - enable CTS*, no interrupts.
; ^^^^^^^^^^^^^^
; ...in INTTBL...
; DEFB INTERR ; ASCI 1 - Console does not use interrupts.
; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; Redirect ALL console I/O through the BIOS vectors to that any programs
; that PATCH the BIOS table will work correctly if the BIOS issues an
; internal error message...
;
; BIOS: JP BOOT ; # 0 Cold start
; WBOOTE: JP WBOOT ; # 1 Warm start
; CONST: JP IOP+12 ; # 2 Console status <-- *
; CONIN: JP IOP+15 ; # 3 Console character in <-- *
; CONOUT: JP IOP+18 ; # 4 Console character out <-- *
; JP IOP+21 ; # 5 List character out
; JP IOP+24 ; # 6 Punch character out
; JP IOP+27 ; # 7 Reader character in
; JP HOME ; # 8 Move head to home position
; JP SELDSK ; # 9 Select disk
; JP SETTRK ; #10 Set track number
; JP SETSEC ; #11 Set sector number
; JP SETDMA ; #12 Set dma address
; JP READ ; #13 Read disk
; JP WRITE ; #14 Write disk
; JP IOP+30 ; #15 Return list status
; JP SECTRAN ; #16 Sector translate
; ; SB-180 BIOS vectors...
; JP IOINIT ; #17 Initialise SB-180.
; JP TIME ; #18 Return pointer to RTC buffer.
;-
;**************************************************************************
;*** Minimum I/O package - supports CONSOLE only. ***
;**************************************************************************
;+
; IOP jump table - all unused entries exit Z (not ready). The jump table is
; constructed using two byte jump relative instructions at 3 byte intervals
; so that the table appears to ZCPR to be a standard IOP.
;-
IOPENT: JR IOPERR ; SELECT returns "NO IOP"
NOP ; Pad to 3 bytes...
JR IOPERR ; SELECT n/a
NOP ;
JR IOPERR ; NAMER n/a
NOP ;
JR IOPERR ; TINIT n/a
NOP ;
JR ICONST ; Local console status support
NOP ;
JR ICONIN ; Local console input support
NOP ;
JR ICONOUT ; Local console output support
NOP ;
JR IOPERR ; LIST n/a
NOP ;
JR IOPERR ; PUNCH n/a
NOP ;
JR IOPERR ; READER n/a
NOP ;
JR IOPERR ; LISTST n/a
NOP ;
JR IOPERR ; NEWIO n/a
NOP ;
JR IOPERR ; COPEN n/a
NOP ;
JR IOPERR ; CCLOSE n/a
NOP ;
JR IOPERR ; LOPEN n/a
NOP ;
JR IOPERR ; LCLOSE n/a
NOP ;
DEFB 'Z3IOP' ; IOP header.
DEFZ 'MINIMUM' ; IOP name.
;+
; General unimplemented error exit.
;-
IOPERR: XOR A ; Return ZERO...
RET ; ...
;+
; Console input status, return 0ffh if char ready, 00h if not.
;-
ICONST: IN0 A,(STAT1) ; Get the console status...
AND RDRF ; ...test for data ready...
RET Z ; ...exit if No character waiting.
;
XOR A ; Return 0FFh if character waiting...
DEC A ; ...
RET ; ...exit READY.
;+
; Get a console character into register A.
;-
ICONIN: IN0 A,(STAT1) ; Get the console status...
AND RDRF ; ...test for data ready...
JR Z,ICONIN ; ...branch until ready.
; Character is waiting.
IN0 A,(RDR1) ; Read character...
AND 01111111B ; ...strip msb...
RET ; ...exit - Char in Acc.
;+
; Console character output from register C.
;-
ICONOUT: IN0 A,(STAT1) ; Check console status register...
AND TDRE ; ...
JR Z,ICONOUT ; Wait for empty register.
OUT0 (TDR1),C ; Output the C register...
RET ; ...exit - done.
IOPLEN EQU $-IOPENT
;**************************************************************************
;*** Modifications to BIOS cold boot routine. ***
;**************************************************************************
;+
; This is the code that must be inserted in the SB180s' COLD BOOT routine
; prior to any use of CONIN, CONST or CONOUT to load the above routines
; into the IOP partition...
;
; LD HL,IOPENT ; Load the minimum IOP...
; LD DE,IOP ; ...into the IOP partition...
; LD BC,IOPLEN ; ...
; LDIR ; ...
;-
END