TITLE 'LP: Device Driver for SC Two Thirds Card' * * Commented disassembly * * G. Roberts 12-Nov-2016 * SPACE 4 STL 'System equates' XTEXT HOSEQU HDOS system equivalences XTEXT ASCII ASCII character equivalences XTEXT DDDEF Device driver communucation flags XTEXT ECDEF System error codes XTEXT PICDEF PIC format equivalences (bytes 0-5) XTEXT DEVDEF Device table entries XTEXT DVDDEF Device driver equivalences XTEXT SETCAL Fixed address routines in SET XTEXT TBRA Branch relative thru table (in ROM) XTEXT TYPTX Type text to console (in ROM) * * ----- Begin position independent code * CODE PIC * * ----- Device header (bytes 6-21) * DB DVDFLV Flag as a Device Driver DB DT.CW Device capability: Write DB 00000001B Mounted unit mask DB 1 Only one unit (unit 0) DB DT.CW Unit 0 : capable of write DS 7 Units 1-7 : don't exist DB DVDFLV Unit capable of SET options DW 0 Pointer to INIT code . SET 025Q Header must be exactly 21 bytes ERRNZ *-. * * ----- Heath reserved area * DS DVD.STE-. Reserve through SeT Entry point EJECT STL 'Flags and assembly constants' PORTA EQU 320Q PORTB EQU 321Q PORTC EQU 322Q PCTRL EQU 323Q CCINT EQU 040334A S.CAADR+1 EJECT STL 'SET processing' *** SET processing entry point * * SET commands enter code here * * ENTRY: (DE) = line pointer * (A) = unit number * * EXIT: 'C' clear : no error * 'C' set : error * (A) = error code * * USES: ALL * SETNTR EQU * ERRNZ *-DVD.STE Must be at SET entry point ANA A Must call unit 0 (only one) JNZ SET1 if not, then return with error MOV B,D else MOV C,E (BC) = parameter list address LXI D,PRCTAB (DE) = processor table address LXI H,OPTTAB (HL) = option table address CALL $SOP Call Set Option Processor RC If error, return CALL $SNA Else Scan for Next Argument RZ if none, then return normally MVI A,EC.ILO Else flag error for ILlegal Option STC and set carry to flag error. RET Return. SET1 MVI A,EC.UUN Unknown Unit Number error STC set carry to flag error. RET Return. SPACE 4,10 *** FLAG * * Process Byte Flag * * ENTRY: (HL) = address of table vector * * EXIT: 'C' clear : no error * 'C' set : error * * USES: ALL * * FLAG EQU $PBF SPACE 4,10 *** VAL * * Process Value Flag option specification * * ENTRY: (BC) = next character address * (HL) = table vector index * * EXIT: (BC) updated * 'C' clear : no error * 'C' set : error * * USES: ALL * * VAL EQU $PBV UNK52 MVI A,EC.ILV STC RET SPACE 4,10 ** HELP * * Type help (list valid options) on colsole * HELP CALL $TYPTX DB ESC,'E' DB ESC,'Y',37,60 Row 37, Col. 60 DB 'SET OPTIONS' DB ESC,'Y',38,57 Row 38, Col. 57 DB '90-1001-700 REV. 1',NL,NL DB TAB,TAB,'MX80' DB TAB,TAB,'SELECT MX80',NL DB TAB,TAB,'NOMX80' DB TAB,TAB,'DESELECT MX80',NL DB TAB,TAB,'WIDTH n' DB TAB,TAB,'CHAR./LINE 1 continue looping MVI A,0 Zero STA TLP.CX Column Index * * Check if need new page * LPWR9 LDA TLP.LPP A = lines per page ANA A Check for 0 JZ LPWR10 Don't care, continue the loop... LDA TLP.LX A = Line Index PUSH H LXI H,TLP.LPP (HL) = Lines per Page INR A Next line STA TLP.LX save it CMP M at max? POP H JNZ LPWR10 no, continue the loop... MVI A,FF yes! Form Feed CALL LPOUTCH output the character JMP LPWR5 and reset LX and CX LPWR10 INX D DCX B JMP LPWR1 LPWR11 PUSH H PUSH PSW CALL LPCLOSE POP PSW POP H RET * * MXHELP - features only on MX80 * MXHELP CALL $TYPTX DB TAB,TAB,'LPI n',TAB,TAB DB 'LINES/INCH (=216/n) 1