i`d eCPMENV FORLw e eCPMENV LIB; i@JZTEST COMD,@ZTEST Z80>`dp ; This is macro code that defines an ENV and TCAP for a CP/M system. ; Ref: TCJ #53 ; PROGRAM: CPMENV.LIB ; AUTHOR: Jay Sage ; DATE: June 16, 1991 ; --------------------- ; System configuration information (***** USER EDIT *****) cpumhz equ 4 ; CPU speed in MHz ; Operating system addrsess and sizes. biospg equ 0eah ; 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 0000000011110001B highdsk equ 'H' maxdisk equ highdsk - '@' maxuser equ 31 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) cpmenv macro ; ; Offset 00h - Leading CBIOS console status jump ; DB 0C3H ; Jump instruction DW 00000H ; dummy console status jump address ; ; Offset 03h - Environment ID ; DB 'Z3ENV' ; ; Offset 08h - Environment type ; ; Bit: 76543210 ENVTYP: DB 10000001B ; Environment type ; ; Bit 0: (External environment) ; Bit 7: Extended environment ; ; Offset 09h - External path ; DW 00000H ; Address DB 0 ; Number of 2 byte path elements ; ; Offset 0Ch - Resident command package ; DW 00000H ; Address DB 0 ; Size in records ; ; Offset 0Fh - Input/output package ; DW 00000H ; Address DB 0 ; Size in records ; ; Offset 12h - Flow control package ; DW 00000H ; Address DB 0 ; Size in records ; ; Offset 15h - Named directory buffer ; DW 00000H ; Address DB 0 ; Number of 18 byte entries ; ; Offset 18h - Multiple command line ; DW 00000H ; Address DB 0 ; Size in bytes ; ; Offset 1Bh - Environment descriptor ; DW intenv ; Load address of this file DB 2 ; Size in records (including Z3TCAP) ; ; Offset 1Eh - Shell stack ; DW 00000H ; Address DB 0 ; Number of shell stack entries DB 0 ; Entry size in bytes ; ; Offset 22h - Message buffer ; DW 00000H ; Address ; ; Offset 24h - External file control block ; DW 00000H ; Address ; ; Offset 26h - External stack ; DW 00000H ; Address ; ; Offset 28h - Quiet flag ; DB 00 ; 0 - Not quiet ; ; 1 - Quiet ; ; Offset 29h - Wheel byte ; DW 00000H ; Address ; ; Offset 2Bh - Processor speed ; DB cpumhz ; ; Offset 2Ch - Maximum drive/user accepted ; DB maxdisk ; Max drive letter DB maxuser ; Max user number DB 1 ; 0 - Don't accept DU: ; ; 1 - Accept DU: ; ; Offset 2Fh - CRT and printer selection ; DB 0 ; CRT selection DB 0 ; Printer selection ; ; Offset 31h - CRT 0 ; DB crtwid ; Number of columns DB crtlen ; Number of lines DB crtuse ; Number of text lines ; ; Offset 34h - Valid drive vector ; DW drvec ; Valid drive vector ; ; Offset 36h - Spare 1 ; DB 0 ; ; Offset 37h - Printer 0 ; DB prtwid ; Number of columns DB prtlen ; Number of lines DB prtuse ; Number of text lines DB prtff ; 0 - Can't do form feeds ; ; 1 - Can do form feeds ; ; Offset 3Bh - Spares 2-5 ; DB 0 ; Spare 2 DB 0 ; Spare 3 DB 0 ; Spare 4 DB 0 ; Spare 5 ; ; Offset 3Fh - Command and control processor ; DW ccp ; Address DB ccps ; Size in records (normally 16) ; ; Offset 42h - Disk operating system ; DW dos ; Address DB doss ; Size in records (normally 28) ; ; Offset 45h - BIOS (NZBIO if running NZCOM) ; DW bios ; Address ; ; Offset 47h - Shell variable files ; SHVAR: DB 'SH ' ; Shell variable filename DB 'VAR' ; Shell variable filetype ; ; Offset 52h - File 1 ; FILE1: DB ' ' ; File 1 DB ' ' ; ; Offset 5Dh - File 2 ; FILE2: DB ' ' ; File 2 DB ' ' ; ; Offset 68h - File 3 ; FILE3: DB ' ' ; File 3 DB ' ' ; ; Offset 73h - File 4 ; FILE4: DB ' ' ; File 4 DB ' ' ; ; Offset 7Eh - ZRDOS public drive/user masks ; PUBDRV: DB 00000000B ; Public drives ; Drives->HGFEDCBA ; PUBUSR: DB 00000000B ; Public user areas ; Users ->87654321 ; ; End of 128 byte environment descriptor ; ESC EQU 27 ; Escape character ; ; The first character in the terminal name must not be a space. For ; Z3TCAP.TCP library purposes only, the name terminates with a space ; and must be unique in the first eight characters. ; TNAME: DB '16/8-Xerox ' ; Name of terminal (13 chars) ; GOFF: DB GOELD-TNAME ; Graphics offset from Z3TCAP start ; ; Terminal configuration bytes B14 and B15 are defined and bits assigned ; as follows. The remaining bits are not currently assigned. Set these ; bits according to your terminal configuration. ; ; B14 b7: Z3TCAP Type.... 0 = Standard TCAP 1 = Extended TCAP ; ; bit: 76543210 DB 10000000B ; Configuration byte B14 ; ; B15 b0: Standout....... 0 = Half-Intensity 1 = Reverse Video ; B15 b1: Power Up Delay. 0 = None 1 = Ten-second delay ; B15 b2: No Auto Wrap... 0 = Auto Wrap 1 = No Auto Wrap ; B15 b3: No Auto Scroll. 0 = Auto Scroll 1 = No Auto Scroll ; B15 b4: ANSI........... 0 = ASCII 1 = ANSI ; ; bit: 76543210 DB 00000001B ; Configuration byte B15 ; ; Single character arrow keys or WordStar diamond ; DB 'A'-40H ; Cursor up DB 'B'-40H ; Cursor down DB 'C'-40H ; Cursor right DB 'D'-40H ; Cursor left ; ; Delays (in ms) after sending terminal control strings ; DB 50 ; CL delay DB 0 ; CM delay DB 0 ; CE delay ; ; Strings start here ; DB ESC,'*',0 ; Home cursor and clear screen DB ESC,'=%+ %+ ',0 ; Cursor motion macro DB ESC,'T',0 ; Erase from cursor to end-of-line DB ESC,')',0 ; Start standout mode DB ESC,'(',0 ; End standout mode DB 0 ; Terminal initialization DB 0 ; Terminal deinitialization ; ; Extensions to standard Z3TCAP ; DB ESC,'R',0 ; Delete line at cursor position DB ESC,'E',0 ; Insert line at cursor position DB ESC,'Y',0 ; Erase from cursor to end-of-screen ; ; The attribute string contains the four command characters to set ; the following four attributes for this terminal in the following ; order: Normal, Blink, Reverse, Underscore ; DB 0 ; Set screen attributes macro DB 0 ; Attribute string DB 0 ; Read current cursor position DB 0 ; Read line until cursor ; ; Graphics TCAP area ; GOELD: DB 0 ; Graphics On/Off delay in ms ; ; Graphics strings ; DB 0 ; Graphics mode On DB 0 ; Graphics mode Off DB 'E'-40H,' ',0 ; Cursor Off DB 'E'-40H,'B'-40H,0 ; Cursor On ; ; Graphics characters ; GULC: DB '+' ; Upper left corner GURC: DB '+' ; Upper right corner GLLC: DB '+' ; Lower left corner GLRC: DB '+' ; Lower right corner GHL: DB '+' ; Horizontal line GVL: DB '+' ; Vertical line GFB: DB '+' ; Full block GHB: DB '+' ; Hashed block GUI: DB '+' ; Upper intersect GLI: DB '+' ; Lower intersect GIS: DB '+' ; Mid intersect GRTI: DB '+' ; Right intersect GLTI: DB '+' ; Left intersect ; ; Fill remaining space with zeros ; REPT 128-($-TNAME) DB 0 ENDM endm  ; PROGRAM: ZTEST.Z80 ; AUTHOR: Jay Sage ; DATE: June 16, 1991 ; This is a program to test the technique of including ; an internal ENV and TCAP maclib cpmenv.lib cseg .request vlib,syslib extrn z3vinit,cls,at ; VLIB routines extrn vprint jp start db 'Z3ENV' db 1 envptr:: dw intenv intenv: cpmenv ; use macro start: ld (stack),sp ld sp,stack ; ld hl,(envptr) call z3vinit ; call cls call at db 10,10 call vprint db 'This is ' db 1 db 'highlighted' db 2 db ' video!' db 0 call at db 22,1 ; ld sp,(stack) ret ; dseg ds 60 stack: ds 2 ; end  Z3ENV Z3ENV PPB:SH VAR 16/8-Xerox ;2*=%+ %+ T)(REY +++++++++++++s<1<* ͘r OThis is highlighted video!r{(R(I(N ү$,}lg0g|͘e||d͝ ͝0/0Gz0 A(͘x~( #\ ~#͘zO* |( +~(G  " |(">|(D~!8? ~2@#~2A#~2BCͅ:@O ͅ !C6#s#r#6#s#r# 6#s#r#~#\ #O>ͮa{_Ͷo*oThis library contains an example of the standard suggested by Jay Sage in his TCJ #52 article for creating programs that run both under CP/M and Z-System. Under Z-System, the true environment is used. Under CP/M an internal environment is used. The ZTEST.COM file may have a new .Z3T installed via the new TCSELECT version 3.x. All I did was type in and test the code. - Lee Bradley, 1/7/92