home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / flife13.lbr / CPMENV.LZB / CPMENV.LIB
Encoding:
Text File  |  1993-02-16  |  7.3 KB  |  323 lines

  1. ;
  2. ; This is macro code that defines an ENV and TCAP for a CP/M system.
  3. ; Ref: TCJ #52
  4.  
  5. ; PROGRAM:    CPMENV.LIB
  6. ; AUTHOR:    Jay Sage
  7. ; DATE:        June 16, 1991
  8.  
  9. ; ---------------------
  10.  
  11. ; System configuration information (***** USER EDIT *****)
  12.  
  13. cpumhz    equ    4        ; CPU speed in MHz
  14.  
  15. ; Operating system addrsess and sizes.
  16.  
  17. biospg    equ    0eah    ; Page where BIOS starts
  18. bios    equ    100h * biospg
  19. doss    equ    28    ; Size of DOS in records
  20. dos    equ    bios - 80h * doss
  21. ccps    equ    16    ; Size of CCP in records
  22. ccp    equ    dos - 80h * ccps
  23.  
  24. ; Information about drives and user areas available
  25.  
  26. ;        PONMLKJIHGFEDCBA        
  27. drvec    equ    1111111111111111B
  28. highdsk    equ    'P'
  29. maxdisk    equ    highdsk - '@'              
  30. maxuser    equ    31
  31.  
  32. crtwid    equ    80    ; Width of CRT screen
  33. crtlen    equ    24    ; Number of lines on screen
  34. crtuse    equ    crtlen - 2    ; Number of lines to use
  35.  
  36. prtwid    equ    80    ; Printer width
  37. prtlen    equ    66    ; Printer total length
  38. prtuse    equ    prtlen - 8    ; Printer lines to use
  39. prtff    equ    1    ; Formfeed flag (1 if used)
  40.  
  41. cpmenv    macro
  42. ;
  43. ; Offset 00h - Leading CBIOS console status jump
  44. ;
  45.     DB    0C3H    ; Jump instruction
  46.     DW    00000H    ; dummy console status jump address
  47. ;
  48. ; Offset 03h - Environment ID
  49. ;
  50.     DB    'Z3ENV'
  51. ;
  52. ; Offset 08h - Environment type
  53. ;
  54. ;    Bit:    76543210
  55. ENVTYP:    DB    10000001B ; Environment type
  56. ;
  57. ;    Bit 0: (External environment)
  58. ;    Bit 7:  Extended environment
  59. ;
  60. ; Offset 09h - External path
  61. ;
  62.     DW    00000H    ; Address
  63.     DB    0       ; Number of 2 byte path elements
  64. ;
  65. ; Offset 0Ch - Resident command package
  66. ;
  67.     DW    00000H    ; Address
  68.     DB    0      ; Size in records
  69. ;
  70. ; Offset 0Fh - Input/output package
  71. ;
  72.     DW    00000H    ; Address
  73.     DB    0       ; Size in records
  74. ;
  75. ; Offset 12h - Flow control package
  76. ;
  77.     DW    00000H    ; Address
  78.     DB    0       ; Size in records
  79. ;
  80. ; Offset 15h - Named directory buffer
  81. ;
  82.     DW    00000H    ; Address
  83.     DB    0       ; Number of 18 byte entries
  84. ;
  85. ; Offset 18h - Multiple command line
  86. ;
  87.     DW    00000H    ; Address
  88.     DB    0       ; Size in bytes
  89. ;
  90. ; Offset 1Bh - Environment descriptor
  91. ;
  92.           DW    intenv    ; Load address of this file
  93.            DB    2       ; Size in records (including Z3TCAP)
  94. ;
  95. ; Offset 1Eh - Shell stack
  96. ;
  97.     DW    00000H    ; Address
  98.     DB    0       ; Number of shell stack entries
  99.     DB    0       ; Entry size in bytes
  100. ;
  101. ; Offset 22h - Message buffer
  102. ;
  103.     DW    00000H    ; Address
  104. ;
  105. ; Offset 24h - External file control block
  106. ;
  107.     DW    00000H    ; Address
  108. ;
  109. ; Offset 26h - External stack
  110. ;
  111.     DW    00000H    ; Address
  112. ;
  113. ; Offset 28h - Quiet flag
  114. ;
  115.     DB    00       ; 0 - Not quiet
  116. ;            ; 1 - Quiet
  117. ;
  118. ; Offset 29h - Wheel byte
  119. ;
  120.     DW    00000H    ; Address
  121. ;
  122. ; Offset 2Bh - Processor speed
  123. ;
  124.     DB    cpumhz
  125. ;
  126. ; Offset 2Ch - Maximum drive/user accepted
  127. ;
  128.     DB    maxdisk    ; Max drive letter
  129.     DB    maxuser    ; Max user number
  130.     DB    1       ; 0 - Don't accept DU:
  131. ;            ; 1 - Accept DU:
  132. ;
  133. ; Offset 2Fh - CRT and printer selection
  134. ;
  135.     DB    0       ; CRT selection
  136.     DB    0       ; Printer selection
  137. ;
  138. ; Offset 31h - CRT 0
  139. ;
  140.     DB    crtwid      ; Number of columns
  141.     DB    crtlen      ; Number of lines
  142.     DB    crtuse      ; Number of text lines
  143. ;
  144. ; Offset 34h - Valid drive vector
  145. ;
  146.          DW    drvec    ; Valid drive vector
  147. ;
  148. ; Offset 36h - Spare 1
  149. ;
  150.     DB    0   
  151. ;
  152. ; Offset 37h - Printer 0
  153. ;
  154.     DB    prtwid      ; Number of columns
  155.     DB    prtlen      ; Number of lines
  156.     DB    prtuse      ; Number of text lines
  157.     DB    prtff       ; 0 - Can't do form feeds
  158. ;                ; 1 - Can do form feeds
  159. ;
  160. ; Offset 3Bh - Spares 2-5
  161. ;
  162.     DB    0       ; Spare 2
  163.     DB    0        ; Spare 3
  164.     DB    0        ; Spare 4
  165.     DB    0        ; Spare 5
  166. ;
  167. ; Offset 3Fh - Command and control processor
  168. ;
  169.         DW    ccp    ; Address
  170.          DB    ccps    ; Size in records (normally 16)
  171. ;
  172. ; Offset 42h - Disk operating system
  173. ;
  174.         DW    dos    ; Address
  175.          DB    doss      ; Size in records (normally 28)
  176. ;
  177. ; Offset 45h - BIOS (NZBIO if running NZCOM)
  178. ;
  179.         DW    bios    ; Address
  180. ;
  181. ; Offset 47h - Shell variable files
  182. ;
  183. SHVAR:    DB    'SH      '    ; Shell variable filename
  184.     DB    'VAR'        ; Shell variable filetype
  185. ;
  186. ; Offset 52h - File 1
  187. ;
  188. FILE1:    DB    '        '    ; File 1
  189.     DB    '   '
  190. ;
  191. ; Offset 5Dh - File 2
  192. ;
  193. FILE2:    DB    '        '    ; File 2
  194.     DB    '   '
  195. ;
  196. ; Offset 68h - File 3
  197. ;
  198. FILE3:    DB    '        '    ; File 3
  199.     DB    '   '
  200. ;
  201. ; Offset 73h - File 4
  202. ;
  203. FILE4:    DB    '        '    ; File 4
  204.     DB    '   '
  205. ;
  206. ; Offset 7Eh - ZRDOS public drive/user masks
  207. ;
  208. PUBDRV:    DB    00000000B ; Public drives
  209. ;    Drives->HGFEDCBA
  210. ;
  211. PUBUSR:    DB    00000000B ; Public user areas
  212. ;    Users ->87654321
  213. ;
  214. ; End of 128 byte environment descriptor
  215. ;
  216. ; Z3TCAP file:  ADM31.Z80
  217. ;
  218. ESC    EQU    27        ; Escape character
  219. ;
  220. ; The first character in the terminal name must not be a space. For
  221. ; Z3TCAP.TCP library purposes only, the name terminates with a space
  222. ; and must be unique in the first eight characters.
  223. ;
  224. TNAME:    DB    'ADM-31       '    ; Name of terminal (13 chars)
  225. ;
  226. GOFF:    DB    GOELD-TNAME    ; Graphics offset from Z3TCAP start
  227. ;
  228. ; Terminal configuration bytes B14 and B15 are defined and bits assigned
  229. ; as follows. The remaining bits are not currently assigned. Set these
  230. ; bits according to your terminal configuration.
  231. ;
  232. ;    B14 b7: Z3TCAP Type.... 0 = Standard TCAP  1 = Extended TCAP
  233. ;
  234. ;    bit:    76543210
  235. B14:    DB    10000000B    ; Configuration byte B14
  236. ;
  237. ;    B15 b0: Standout....... 0 = Half-Intensity 1 = Reverse Video
  238. ;    B15 b1: Power Up Delay. 0 = None           1 = Ten-second delay
  239. ;    B15 b2: No Auto Wrap... 0 = Auto Wrap      1 = No Auto Wrap
  240. ;    B15 b3: No Auto Scroll. 0 = Auto Scroll    1 = No Auto Scroll
  241. ;    B15 b4: ANSI........... 0 = ASCII          1 = ANSI
  242. ;
  243. ;    bit:    76543210
  244. B15:    DB    00000000B    ; Configuration byte B15
  245. ;
  246. ; Single character arrow keys or WordStar diamond
  247. ;
  248.     DB    0        ; Cursor up
  249.     DB    0        ; Cursor down
  250.     DB    0        ; Cursor right
  251.     DB    0        ; Cursor left
  252. ;
  253. ; Delays (in ms) after sending terminal control strings
  254. ;
  255.     DB    0        ; CL delay
  256.     DB    0        ; CM delay
  257.     DB    0        ; CE delay
  258. ;
  259. ; Strings start here
  260. ;
  261. CL:    DB    ESC,'+',0    ; Home cursor and clear screen
  262. CM:    DB    ESC,'=%+ %+ ',0    ; Cursor motion macro
  263. CE:    DB    ESC,'T',0    ; Erase from cursor to end-of-line
  264. SO:    DB    ESC,')',0    ; Start standout mode
  265. SE:    DB    ESC,'(',0    ; End standout mode
  266. TI:    DB    0        ; Terminal initialization
  267. TE:    DB    0               ; Terminal deinitialization
  268. ;
  269. ; Extensions to standard Z3TCAP
  270. ;
  271. LD:    DB    ESC,'R',0    ; Delete line at cursor position
  272. LI:    DB    ESC,'E',0    ; Insert line at cursor position
  273. CD:    DB    ESC,'Y',0    ; Erase from cursor to end-of-screen
  274. ;
  275. ; The attribute string contains the four command characters to set
  276. ; the following four attributes for this terminal in the following
  277. ; order:      Normal, Blink, Reverse, Underscore
  278. ;
  279. SA:    DB    0        ; Set screen attributes macro
  280. ATS:    DB    0        ; Attribute string
  281. RC:    DB    0        ; Read current cursor position
  282. RL:    DB    0        ; Read line until cursor
  283. ;
  284. ; Graphics TCAP area
  285. ;
  286. GOELD:    DB    0        ; Graphics On/Off delay in ms
  287. ;
  288. ; Graphics strings
  289. ;
  290. GO:    DB    0        ; Graphics mode On
  291. GE:    DB    0        ; Graphics mode Off
  292. CDO:    DB    0        ; Cursor Off
  293. CDE:    DB    0        ; Cursor On
  294. ;
  295. ; Graphics characters
  296. ;
  297. GULC:    DB    '*'        ; Upper left corner
  298. GURC:    DB    '*'        ; Upper right corner
  299. GLLC:    DB    '*'        ; Lower left corner
  300. GLRC:    DB    '*'        ; Lower right corner
  301. GHL:    DB    '-'        ; Horizontal line
  302. GVL:    DB    '|'        ; Vertical line
  303. GFB:    DB    '#'        ; Full block
  304. GHB:    DB    '#'        ; Hashed block
  305. GUI:    DB    '+'        ; Upper intersect
  306. GLI:    DB    '+'        ; Lower intersect
  307. GIS:    DB    '+'        ; Mid intersect
  308. GRTI:    DB    '+'        ; Right intersect
  309. GLTI:    DB    '+'        ; Left intersect
  310. ;
  311. ;  Fill remaining space with zeros
  312. ;
  313.      REPT    128-($-TNAME)
  314.     DB    0
  315.      ENDM
  316.  
  317. ;
  318. ; End of Z3TCAP
  319. ;
  320.  
  321.     endm
  322.  
  323.