TITLE 'NORTH STAR BIOS FOR CODE 3955 1 MAY 85' ;BIOS3955.ASM MAY 1 1985 ;CONFIGURED FOR 56K SYSTEM FOR CODE 3955 ;This USER AREA is for a Horizon computer ;as used in a 56K Lifeboat CP/M2 on North Star. ;Change MSIZE to the memory size desired. MSIZE EQU 56 ;Distribution system ;The following equates are automatically changed by MSIZE. BIOS EQU 5300H+(MSIZE-24)*1024 CCP EQU BIOS-1600H BDOS EQU CCP+800H USER EQU BIOS+700H ;For double/quad density OFFSET EQU 2000H-BIOS ;To overlay SYSGEN IMAGE IOBYT EQU 3 ;Storage location ORG USER ;Origin of this program ;THE JUMP TABLE FOLLOWING MUST BE PRESENT AND ;THE SEQUENCE OF JUMPS MAY NOT BE CHANGED JMP CINIT ;Initialize I/O ports JMP WINIT ;Warm boot init JMP CONST ;Console status JMP CONIN ;Console input JMP CONOUT ;Console output JMP LIST ;Printer output JMP PUNCH ;Punch output JMP READER ;Reader input JMP LISTST ;Printer status DW UALEN ;Length of USER AREA INIOBY: DB 0 ;Initial IOBYT value DB 0,0,0 ;Reserved ;YOU MAY MAKE ANY CHANGES DESIRED FROM THIS POINT ON. ;KEEP THE TOTAL USER AREA UNDER 512 BYTES. ; LOGICAL I/O ROUTINES ;Each logical I/O routine loads the IOBYT at address 3, ;rotates the proper two bit field into bits 0 and 1, ;and calls the DSPCH routine which selects one ;of the four physical drivers from the table following ;depending on the value of bits 0 and 1. ;The LIST routine has been fully commented to aid you. CONST: ;Select console status routine. LDA IOBYT CALL DSPCH ; ; CONSOLE STATUS DISPATCH TABLE ; DW LSERST ;Left serial DW RSERST ;Right serial DW LISTST ;Batch mode DW PARST ;Parallel port ; CONIN: ;Select console input routine. LDA IOBYT CALL DSPCH ; ; CONSOLE INPUT DISPATCH TABLE ; DW LSERIN ;Left serial DW RSERIN ;Right serial DW READER ;Batch mode DW PARIN ;Parallel port ; CONOUT: ;Select console output routine. LDA IOBYT CALL DSPCH ; ; CONSOLE OUTPUT DISPATCH TABLE ; DW LSEROUT ;Left serial DW RSEROUT ;Right serial DW LIST ;Batch mode DW PAROUT ;Parallel port ; LIST: ;Select a list driver. LDA IOBYT ;Load IOBYT from address 4. RLC ;Rotate LIST selection bits RLC ;into bit position 0 and 1. CALL DSPCH ;Call dispatcher. ;The dispatcher selects a routine from the table ;following depending on the value of bits 0-1. ;The selected routine will return to the caller. ; DW PAROUT ;00B = Parallel port DW PAROUT ;01B = Parellel port DW RSEROUT ;10B = Right serial DW RSEROUT ;11B = Right serial ; PUNCH: ;Select as PUNCH driver. LDA IOBYT RRC RRC RRC RRC CALL DSPCH ; ; PUNCH DEVICE DISPATCH TABLE ; DW LSEROUT DW RSEROUT DW PAROUT DW PAROUT ; READER: ;Select a READER driver. LDA IOBYT RRC RRC CALL DSPCH ; ; READER DEVICE DISPATCH TABLE ; DW LSERIN DW RSERIN DW PARIN DW PARIN ; LISTST: ;List status not implemented. XRA A RET ; DSPCH: ;Select routine from table of caller. ANI 3 ;Mask IOBYT and RLC ;mult times 2. MOV E,A ;Put index into MVI D,0 ;DE register. POP H ;Get addr of table DAD D ;and add index. MOV E,M ;Get addr of routine INX H ;into MOV D,M ;DE first, XCHG ;then put into HL PCHL ;and transfer control. ; ; PHYSICAL STATUS ROUTINES ; LSERST: ;Left serial port status. IN 3 ANI 2 RZ ;No key MVI A,0FFH RET ;Char ready ; RSERST: ;Right serial port status. IN 5 ANI 2 RZ ;No key MVI A,0FFH RET ;Char ready ; PARST: ;Parallel port status. IN 6 ANI 2 RZ MVI A,0FFH RET ; ; PHYSICAL INPUT ROUTINES ; LSERIN: ;Left serial port input. IN 3 ANI 2 JZ LSERIN IN 2 ANI 7FH RET ; RSERIN: ;Right serial port input. IN 5 ANI 2 JZ RSERIN IN 4 ANI 7FH RET ; PARIN: ;Parallel port input. IN 6 ;Motherboard status ANI 2 JZ PARIN IN 0 ;Read keyboard PUSH PSW ;Save char MVI A,30H OUT 6 ;Reset PI flag POP PSW ANI 7FH RET ; ; PHYSICAL OUTPUT ROUTINES ; LSEROUT: ;Left serial port output. IN 3 ANI 1 JZ LSEROUT MOV A,C OUT 2 RET ; RSEROUT: ;Right serial port output. IN 5 ANI 1 JZ RSEROUT MOV A,C OUT 4 RET ; PAROUT: ;Parallel port output. IN 6 ;Motherboard status ANI 1 JZ PAROUT MVI A,20H ;Reset PO flag OUT 6 ;Output char MOV A,C ;Load accumulator TIN1: ORI 80H ;Set strobe false OUT 0 ;and send character XRI 80H ;Toggle strobe OUT 0 ;Output XRI 80H ;and toggle again OUT 0 ANI 7FH ;Mask to ASCII RET ; ; HORIZON HARDWARE INITIALIZATION ; WINIT: ;Warm boot initialization. DB 0,0,0 ;May be patched RET ; CINIT: ;Cold boot initialization. LDA INIOBY ;Get initial IOBYT STA IOBYT ;and store CALL USINIT ;User init routine ; ;Init motherboard and set up serial ports. XRA A OUT 6 OUT 6 OUT 6 OUT 6 ;Init left serial port (Standard console). MVI A,0CEH ;Set 2 stop bits OUT 3 ;to first serial port MVI A,37H ;CMMD: RTS ER RXF DTR TXEN OUT 3 ;to first port ;Init right serial port. MVI A,0CEH ;Set 2 stop bits OUT 5 ;to second serial port MVI A,37H ;Same command OUT 5 ;to second port ;0CEH sets 2 stop, 8 data bits, 16X clock, no parity. ;04EH sets 1 stop, 8 data bits, 16X clock, no parity. ;Parity initialization. MVI A,40H ;Disarm parity logic OUT 0C0H LXI H,0 MVI A,0E0H ;Loop to set parity for first 56K of RAM. TINCP: MOV B,M ;Read byte MOV M,B ;Put back with parity set INR L ;Next memory location JNZ TINCP INR H ;Next 256 byte page CMP H ;up to 0E0H JNZ TINCP ;Enable parity logic on memory board. MVI A,41H OUT 0C0H ;Clear input buffers on serial ports. IN 2 IN 4 ;Init parallel port. MVI A,30H OUT 6 ;Reset parallel port PI flag MVI A,60H ;Code to set PO flag OUT 6 MVI A,0DH ;Output a carrige return JMP TIN1 ;to parallel port ; ; SPECIAL INITIALIZATION FOR USER ; USINIT: ; ; CLEAR SCREEN ON TELEVIDEO 950 TERMINAL ; MVI A,01BH ;ESCAPE CHARACTER CALL CONOUT ;SEND IT MVI A,02AH ;* CHARACTER CALL CONOUT ;SEND IT ; ; SEND PRINTER ROUTING MESSAGE TO SCREEN ; MVI A,9 ;FUNCTION 9 IS PRINT STRING LXI D,MESSAGE ;POINT TO MESSAGE CALL 005H ;CALL BDOS TO EXECUTE FUNCTION RET ; ; MESSAGE AREA ; MESSAGE: DB 0DH,0AH,0AH,0AH ;SPACE DOWN 3 LINES DB ' TO CHANGE PRINTERS, ENTER:' DB 0DH,0AH DB 'SUBMIT LASER (CHANGES TO LASER PRINTER)' DB 'SUBMIT EPSON (CHANGES TO EPSON PRINTER)' DB 0DH,0AH,0AH,'$' ; ; ;LASER.SUB IS: STAT LST:=LPT: ;EPSON.SUB IS: STAT LST:=TTY: ; UALEN EQU $-USER ;LENGTH ; END