name ('lnksbs') title LINK-80 Subroutines .z80 .comment ~ ******************************************************************************************** ******************************************************************************************** *** *** *** *** *** ********** ********** ********** *** *** *** *** *** *********** *********** *********** *** **** *** *** *** *** *** *** *** *** ***** *** *** *** *** *** *** *** *** ****** *** *** *** *** *** *** *** *** *** *** *** ****** ********* ********** ********* *** *** *** *** ******* ********* ********** ********* *** *** ****** *** *** *** *** *** *** *** *** ***** *** *** *** *** *** *** *** *** **** *** *** *** *** *** *** ************ *** *** *** *** *********** *********** *********** ************ *** *** *** *** ********** ********** ********** ******************************************************************************************** ******************************************************************************************** L O A D E R . M A C Version 1.68 Creation Date: 07 January 1983 MODULE: 1.10 Date Last Revised: 07 January 1983 Link-80 User Customized Support Subroutines and Values Edit History: 21 Apr 82 - Created by Dave Norris. 07 Jan 83 - Modified for Systems Group CPC-2810 by Mike Pinkston. ~ subttl Module's GLOBAL entry points page 60 GLOBAL Init, Clrcm1, Cmchk1, Cmin1, Cmout1, Clear, Drives, Speed GLOBAL Ptrig, Phalt, Pwait, Pcont, Pabort subttl Module equate statements page BDOS.Vector EQU 0005H ; BDOS Vector entry point. Status.Port EQU 01H ; Status port. Data.Port EQU 00H ; Data port. Trans.Buffer.Emp EQU 01H ; Bit mask xmtr buffer empty bit (Ready high). Data.Available EQU 02H ; Data available bit (Ready high). Carriage.Return EQU 0DH ; Carriage Return. Line.Feed EQU 0AH ; Line Feed. Escape EQU 1BH ; Escape. subttl Link80 Subroutine Jump Tables page Init: JP Initialize ; Initialization Clrcm1: JP ClrCom ; Clear comm channel Cmchk1: JP Check.Comm.Link ; Check channel Cmin1: JP InCom ; Input byte Cmout1: JP OutCom ; Output byte ; These locations are vectored to the ; appropriate strings... Clear: DEFW ClrScr ; String to clear screen Drives: DEFW DrvAvl ; Drive letters available Speed: DEFW CPU.Speed ; CPU speed ; These locations are needed only if ; the user intends to use the TERMINAL ; mode to transfer files to LINK80 and ; MUST be customized in order for the ; routines to work. Ptrig: DEFW PrgTrg ; Trigger string to initiate listing Phalt: DEFW PrgHlt ; String to halt remote mainframe listing Pwait: DEFW PrgWt ; Match string informing us remote has halted Pcont: DEFW PrgCnt ; String to continue remote listing Pabort: DEFW PrgAbt ; String to abort remote listing subttl page Initialize: LD HL,INIT.TABLE LD BC,6*256+STATUS.PORT OTIR LD DE,ClrScr ; Clear the screen of any garbage. LD C,9 ; CALL BDOS.Vector ; RET ; Clear communications channel ; Do not output anything to the remote!!!!!! ClrCom: IN A,(Data.Port) IN A,(Data.Port) RET ; Check communications channel for anything ; Return with accumulator=0 if nothing ready, ; non-zero if a byte is waiting Check.Comm.Link: IN A,(Status.Port) AND Data.Available RET Z LD A,0FFH RET page InCom: CALL Check.Comm.Link JR Z,InCom LD C,00H ; Reset USART error byte IN A,(Data.Port) ; Get good data RET ; Output byte to remote computer OutCom: PUSH AF OutCm1: IN A,(Status.Port) AND Trans.Buffer.Emp JR Z,OutCm1 POP AF OUT (Data.Port),A RETURN: RET ; Default return subttl Link80 Subroutines Data Area page ClrScr: DEFB Escape,'v$' ; String to clear screen DrvAvl: DEFB 'ABCDEFG', 0 ; String containg available drives CPU.Speed: DEFB 4 ; CPU speed Init.Table: DB 0,0,0,40H,0CEH,37H ; subttl Terminal Mode strings page .comment ~ These strings are used only in the TERMINAL mode file input routine and are not needed unless this command is to be used. The string begins with a length byte which can be zero in the case of Program Wait and ends with the string itself. Use extreme caution here as incorrect values can easily cause LINK80 to abort or "go into hiding" and require a cold boot. They are initialized to communicate to another computer running CP/M. ~ PrgTrg: DEFB Carriage.Return, 0 ; String to initiate listing on remote ; computer, usually a Carriage Return ; as the list command will be followed ; by an Escape (LINK80 sets up file) and ; a Carriage Return to "transmit" the ; string. PrgHlt: DEFB 13H, 0 ; String to temporarily halt the ; remote listing. Set up here as a ; control-S, the CP/M halt print ; character. PrgWt: DEFB 0 ; String that remote sends to indicate ; program listing has halted - Null ; string will cause LINK80 to wait a ; predetermined period of time as ; remote does not send a Program Wait ; string. PrgCnt: DEFB 11H, 0 ; String issued to remote to continue ; program listing. Set up here as ; Carriage Return for CP/M (any ; character would have done...). PrgAbt: DEFB 03H, 0 ; String issued to remote to abort ; program listing. Set up here as ; Carriage Return for CP/M ("TYPE" ; command). DEFB 'End of Linksbs',00 END