home *** CD-ROM | disk | FTP | other *** search
- ;
- ; This is macro code that defines an ENV and TCAP for a CP/M system.
- ; Ref: TCJ #52
-
- ; 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 1111111111111111B
- highdsk equ 'P'
- 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
- ;
- ; Z3TCAP file: ADM31.Z80
- ;
- 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 'ADM-31 ' ; 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
- B14: 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
- B15: DB 00000000B ; Configuration byte B15
- ;
- ; Single character arrow keys or WordStar diamond
- ;
- DB 0 ; Cursor up
- DB 0 ; Cursor down
- DB 0 ; Cursor right
- DB 0 ; Cursor left
- ;
- ; Delays (in ms) after sending terminal control strings
- ;
- DB 0 ; CL delay
- DB 0 ; CM delay
- DB 0 ; CE delay
- ;
- ; Strings start here
- ;
- CL: DB ESC,'+',0 ; Home cursor and clear screen
- CM: DB ESC,'=%+ %+ ',0 ; Cursor motion macro
- CE: DB ESC,'T',0 ; Erase from cursor to end-of-line
- SO: DB ESC,')',0 ; Start standout mode
- SE: DB ESC,'(',0 ; End standout mode
- TI: DB 0 ; Terminal initialization
- TE: DB 0 ; Terminal deinitialization
- ;
- ; Extensions to standard Z3TCAP
- ;
- LD: DB ESC,'R',0 ; Delete line at cursor position
- LI: DB ESC,'E',0 ; Insert line at cursor position
- CD: 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
- ;
- SA: DB 0 ; Set screen attributes macro
- ATS: DB 0 ; Attribute string
- RC: DB 0 ; Read current cursor position
- RL: DB 0 ; Read line until cursor
- ;
- ; Graphics TCAP area
- ;
- GOELD: DB 0 ; Graphics On/Off delay in ms
- ;
- ; Graphics strings
- ;
- GO: DB 0 ; Graphics mode On
- GE: DB 0 ; Graphics mode Off
- CDO: DB 0 ; Cursor Off
- CDE: DB 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
-
- ;
- ; End of Z3TCAP
- ;
-
- endm
-