Listing 2. This is macro code that defines an ENV and TCAP for a CP/M system. ; PROGRAM: CPMENV.LIB ; AUTHOR: Jay Sage ; DATE: June 16, 1991 ; -------------------------------------------------------- ; System configuration information (***** USER EDIT *****) cpumhz equ 4 ; CPU speed in MHz ; Operating system addresses and sizes. biospg equ 0d1h ; Page where BIOS starts bios equ 100h * biospg doss equ 28 ; Size of DOS in records dos equ bios - 80h * doss ccps equ 16 ; Size of CCP in records ccp equ dos - 80h * ccps ; Information about drives and user areas available ; PONMLKJIHGFEDCBA drvec equ 0000000000001111B highdsk equ 'D' ; Letter of highest drive maxdisk equ highdsk - '@' ; Highest drive (A=1) maxuser equ 31 ; Highest user area ; Data about console screen and printers crtwid equ 80 ; Width of CRT screen crtlen equ 24 ; Number of lines on screen crtuse equ crtlen -2 ; Number of lines to use prtwid equ 80 ; Printer width prtlen equ 66 ; Printer total length prtuse equ prtlen - 8 ; Printer lines to use prtff equ 1 ; Formfeed flag (1 if used) ; -------------------------------------------------------- ; Here is a macro to define and internal ENV for use ; under CP/M. cpmenv macro jp 0 ; Dummy jump address db 'Z3ENV' ; Environment ID db 81h ; ENV type dw 0 ; external path db 0 ; elements in path dw 0 ; RCP address db 0 ; number of records in RCP ; LOTS MORE OMITTED dw intenv ; ZCPR3 Environment Descriptor db 2 ; number of records in ENV ; LOTS MORE ZERO VALUES db cpumhz ; Processor Speed in MHz db maxdisk ; maximum disk db maxuser ; maximum user db 1 ; 1=OK to accept DU, 0=not OK db 0,0 db crtwid ; width of CRT db crtlen ; number of lines on CRT db crtuse ; number of lines of text on CRT dw drvec db 0 db prtwid ; data for printer db prtlen db prtuse db prtff db 0,0,0,0 dw ccp db ccps dw dos db doss dw bios db 'SH ' ; shell variable filename db 'VAR' ; shell variable filetype db ' ' ; filename 1 db ' ' ; filetype 1 ; MORE SIMILAR DATA ; Fill unused space with nulls rept 128-($-intenv) db 0 endm ; End of Environment Descriptor -- beginning of TCAP ; ***** USER EDIT ***** ; Extended Termcap Data ESC EQU 27 ; ASCII escape character ; I have adopted the convention that a terminal name is ; terminated with a space character, therefore no spaces ; within the name. Also that the terminal name is unique ; in the first eight characters. NZTCAP: DB 'WYSE-50D ' ; Terminal name (13 bytes) ; The Graphics section is no longer fixed so we must ; provide an offset to it. One byte is sufficient for a ; two-record TCAP. DB GOELD-NZTCAP ; Offset to GOELD ; Bit 7 of B14 indicates the new Extended TCAP. Bits 6-0 ; are undefined. DB 10000000B ; Extended TCAP ; B15 b0 Standout 0 = dim, 1 = inverse ; B15 b1 Power Up Delay 0 = None, 1 = 10-sec delay ; B15 b2 No Wrap 0 = Line Wrap, 1 = No Wrap ; B15 b3 No Scroll 0 = Scroll, 1 = No Scroll ; B15 b4 ANSI 0 = ASCII, 1 = ANSI DB 00000111B DB 'K'-'@' ; Cursor up DB 'J'-'@' ; Cursor down DB 'L'-'@' ; Cursor right DB 'H'-'@' ; Cursor left DB 00 ; Clear-screen delay DB 00 ; Cursor movement delay DB 00 ; Clear-to-end-of-line delay ; Strings start here. DB ESC,'+',0 ; Clear-screen string DB ESC,'=%+ %+ ',0 ; Cursor movement string DB ESC,'T',0 ; Clear-to-end-of-line DB ESC,')',0 ; Standout-on string DB ESC,'(',0 ; Standout-end string DB 0 ; Terminal init string DB ESC,'(',0 ; Terminal deinit string ; Extensions to Standard Z3TCAP DB ESC,'R',0 ; Line Delete DB ESC,'E',0 ; Line Insert DB ESC,'Y',0 ; Clear-to-end-of-screen ; Set Attribute strings once again included. DB ESC,'G',0 ; Set Attributes DB '0248',0 ; Attributes ; These two allow reading the Terminal's screen. DB ESC,'?',0 ; Read current cursor pos DB ESC,'6',0 ; Read line until cursor ; Graphics start here. GOELD: DB 0 ; On/Off Delay ; Graphics strings offset from Delay value. DB ESC,'H',2,0 ; Graphics mode On DB ESC,'H',3,0 ; Graphics mode Off DB ESC,'`0',0 ; Cursor Off DB ESC,'`1',0 ; Cursor On ; Graphics Characters DB '2' ; Upper left corner DB '3' ; Upper right corner DB '1' ; Lower left corner DB '5' ; Lower right corner DB ':' ; Horizontal line DB '6' ; Vertical line DB '7' ; Full block DB ';' ; Hashed block DB '0' ; Upper intersect DB '=' ; Lower intersect DB '8' ; Mid intersect DB '9' ; Right intersect DB '4' ; Left intersect ; Fill unused space with nulls REPT 128-($-NZTCAP) DB 0 ENDM ; End of NZTCAPD endm