TDL Macro assembler Page 1 VEDIT - ] IF MEMVRS, [ .INSERT VEDIT-M3 ; ; GETKEY - Get Keyboard Character. Cursor is blinked while waiting ; for character. Return: char. in 'C'. ; 1D7E CDBD1D GETKEY: CALL CURSON ;Turn the cursor on. 1D81 CD8C1D CALL KEYDEL ;Keyboard check and delay. 1D84 CDF71D CALL CUROFF ;Turn cursor off. 1D87 CD8C1D CALL KEYDEL ;Keyboard check and delay. 1D8A 18F2 JMPR GETKEY ;Wait here. ; 1D8C 3A8B25 KEYDEL: LDA BLNKRT ;Get the blink rate. 1D8F 47 MOV B,A ;Make blink rate the loop count. 1D90 C5 KEYDE1: PUSH B ;Save the count. 1D91 CD6620 CALL GETSTA ;Is char ready? 1D94 C1 POP B ;Restore count. 1D95 2008 JRNZ GETOUT ;Yes, branch. 1D97 3E14 MVI A,20 ;Get delay value. 1D99 CDEA1F CALL DELAY ;Perform the delay. 1D9C 10F2 DJNZ KEYDE1 ;Here for 20 * BLNKRT milliseconds. 1D9E C9 RET ;(GETKEY) ; 1D9F C1 GETOUT: POP B ;Ignore return to GETKEY. 1DA0 CDFF1D CALL CUROF1 ;Turn cursor off. 1DA3 C33520 JMP VGTCHR ;Get char. in both A and C. ;Return to routine which called GETKEY. ; ; LINBGN - Return in HL begin address of current screen line. ; 1DA6 3A4423 LINBGN: LDA CURLIN ;Get current line number. 1DA9 1803 JMPR VERSC1 ;Get current screen address. ; ; VERSCR - Return in HL screen position for line cursor is on. ; 1DAB 3A5623 VERSCR: LDA CURVER ;Get vertical cursor pos. 1DAE 212A26 VERSC1: LXI H,SCADTB ;HL-> Screen line address table. 1DB1 C3191F JMP TBLADD ;Get line address into HL. ; ; COMPCR - Compute cursor screen position from CURVER and CURHOR. ; 1DB4 CDAB1D COMPCR: CALL VERSCR ;Get screen line address. 1DB7 3A5723 LDA CURHOR ;Get horizontal displacement. 1DBA C3E81E JMP ADDAHL ;Add it. ; ] ; ; CURSON - Place the cursor on the screen, saving the ; Character there. ; 1DBD 3A8A25 CURSON: LDA CURTYP ;Get the cursor flag. (Bit 7 if cursor On) 1DC0 B7 ORA A ;Is the cursor already ON? 1DC1 F8 RM ;Yes, return. 1DC2 F5 PUSH PSW ;No, save the cursor type. 1DC3 CD2D1E CALL SCRIN ;Bank select the screen in. TDL Macro assembler Page 2 VEDIT - 1DC6 CDB41D CALL COMPCR ;Compute cursor position in HL. 1DC9 225923 SHLD CURSOR ;Save the cursor pos. 1DCC 225C23 SHLD SCRPNT ;Save as screen pointer too. 1DCF 7E MOV A,M ;Get character at cursor pos. 1DD0 325B23 STA HOLD ;Save it. 1DD3 F1 POP PSW ;Get the cursor type. 1DD4 C2DD1D JNZ CURSO2 ;Branch if not underline. 1DD7 3A6525 LDA CURSCH ;Get the cursor char. 1DDA C3F31D JMP CURSO5 ;Put cursor on screen. ; 1DDD F680 CURSO2: ORI 80H ;Set cursor ON bit. 1DDF 328A25 STA CURTYP ;Save cursor flag. 1DE2 FE83 CPI 83H ;Is cursor hardware attribute type? 1DE4 CAED1D JZ CURSO3 ;Yes, branch. 1DE7 7E MOV A,M ;No, get the screen char. again. 1DE8 F680 ORI 80H ;Make into reverse video. 1DEA C3F31D JMP CURSO5 ;Put cursor on screen. ; ; This is initially set up for the type of hardware attribute ; as found on the SSM VB-3 board. ; 1DED 3E07 CURSO3: MVI A,07H ;Get the attribute byte. Note: Change ;the "07H" for different cursor types. 1DEF 010010 CURSO4: LXI B,1000H ;Offset to the hardware attributes. 1DF2 09 DAD B ;HL-> attribute byte for char on screen. ;{CURSON,CUROFF} 1DF3 77 CURSO5: MOV M,A ;Put on screen, (or change attribute). 1DF4 C3411E JMP SCROUT ;Bank select the screen out. ; ; CUROFF - Restore character under the cursor or turn cursor off. ; 1DF7 3A8A25 CUROFF: LDA CURTYP ;Get the cursor type. 1DFA E67F ANI 7FH ;Ignore On/Off bit. 1DFC FE02 CPI 2 ;Is it blinking? 1DFE D0 RNC ;No, leave it alone. ;{GETOUT} 1DFF 218A25 CUROF1: LXI H,CURTYP ;HL-> cursor flag. 1E02 7E MOV A,M ;Get the flag. 1E03 E67F ANI 7FH ;Set flag for cursor OFF. 1E05 77 MOV M,A ;Save flag. 1E06 2A5923 LHLD CURSOR ;HL -> cursor pos. 1E09 CD2D1E CALL SCRIN ;Bank select the screen in. 1E0C FE03 CPI 3 ;Is cursor hardware attribute type? 1E0E CA171E JZ CUROF2 ;Yes, branch. 1E11 3A5B23 LDA HOLD ;No, get char. under cursor. 1E14 C3F31D JMP CURSO5 ;Branch to put on screen. ; 1E17 3E03 CUROF2: MVI A,03H ;Get the attribute byte. 1E19 C3EF1D JMP CURSO4 ;Change attribute byte, de-select screen. ; 1E1C DS 16 ;User patch space. ; ; Routines for bank select and hardware cursor control. ; All registers must be saved, including PSW! ; ] TDL Macro assembler Page 3 VEDIT - ; ; The Bank Select and Hardware Cursor Select routines can ; generally be implemented by changing the initial "RET" ; to a "PUSH PSW", sending the proper bytes to output ports, ; in the patch space provided and then doing a "POP PSW" and ; a "RET". ; 1E2C 00 BNKSEL: DB 00 ;Change to 01 if Video screen overlays ;Text Buffer up begin of BDOS. ; 1E2D C9 SCRIN: RET ;Default to no bank select. 1E2E 3E01 MVI A,1 ;Get non zero. 1E30 323823 STA BANKFL ;Set screen bank select flag. 1E33 DS 14 ;Patch space for bank select screen in. ; 1E41 C9 SCROUT: RET ;Default to no bank select. 1E42 AF XRA A ;Get a zero. 1E43 323823 STA BANKFL ;Clear screen bank select flag. 1E46 DS 14 ;Patch space for bank select screen out. ; ; The hardware cursor select OFF and ON are only called at entry ; to and exit from visual mode, respectively. ; 1E54 C9 HCRSOF: RET ;Default to no hardware cursor off. 1E55 DS 14 ;Patch space to turn hardware cursor off. ; 1E63 C9 HCRSON: RET ;Default to no hardware cursor on. 1E64 DS 14 ;Patch space to turn hardware cursor on. ] ; ] IF CRTVRS, [ .INSERT VEDIT-T3 .PRNTX /VEDIT-T3/ ] ; ; PIICEON and TDL - ; ] IF PICVRS ! TDLVRS, [ .INSERT VEDIT-P3 .PRNTX /VEDIT-P3/ ] ; ; Back to all versions - ; ] TDL Macro assembler Page 4 VEDIT - ; ; These are the alternate Console I/O entry points when direct ; I/O calls in MP/M are used. Note that although BDOS CALL 6 ; is used, these routines only work for MP/M since CP/M 2.2 and ; MP/M are quite different in this regard. Enough patch space ; is provided for conversion to CP/M 2.2, or for special user ; interfacing. ; 20A7 C3B320 MPMTBL: JMP MPMST ;This table is copied to the BIOS jump 20AA C3C020 JMP MPMIN ;vectors below for the MPM version. 20AD C3D320 JMP MPMOUT 20B0 C3DD20 JMP MPMLST ; 20B3 0E06 MPMST: MVI C,CONSIO ;Perform direct console I/O. 20B5 1EFE MVI E,0FEH ;FE denotes console status. 20B7 C30500 JMP BDOS ;Get input status. 20BA DS 6 ;Patch space for STA TEMPCH, RET ; 20C0 0E06 MPMIN: MVI C,CONSIO ;No, perform direct console input. 20C2 1EFF MVI E,0FFH ;FF denotes console input. 20C4 C30500 JMP BDOS ;Get console char. when available. 20C7 DS 12 ;Patch space. ; 20D3 59 MPMOUT: MOV E,C ;Put the character in E. 20D4 0E06 MVI C,CONSIO ;Perform direct console I/O. 20D6 C30500 JMP BDOS ;Send char. to console through CPM. 20D9 DS 4 ;Patch space. ; 20DD 59 MPMLST: MOV E,C ;Put the character in E. 20DE 0E05 MVI C,5 ;Perform BDOS listing. 20E0 C30500 JMP BDOS ;Send char. to listing through CPM. 20E3 DS 4 ;Patch space. ; ; ; Internal copy of BIOS I/O jump vectors. ; 20E7 C30000 CONST: JMP 00 ;Console status. 20EA C30000 CONINA: JMP 00 ;Get console character. 20ED C30000 CONOUT: JMP 00 ;Send console character. 20F0 C30000 LSTOUT: JMP 00 ;Send listing character. .PRNTX /VEDIT-S2/ ;