home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / PROGPACK / Z34CMN.LIB < prev    next >
Text File  |  2000-06-30  |  5KB  |  155 lines

  1. .comment ~
  2.  
  3.  Library:  Z34CMN.LIB
  4.  Author:   Joe Wright
  5.  Date:     23 March 1988
  6.  
  7.  Modern assemblers provide for the use of up to twelve named common
  8.  blocks.  The actual addresses of these blocks need not be known at
  9.  the time of assembly, but are supplied later by the linker or loader.
  10.  NZ-COM will allow the use of seven of these twelve blocks.
  11.  
  12.  This library is to be included in the assembly of the segments in
  13.  place of Z3BASE.LIB.  Note that the seven blocks declared here have
  14.  only equates and no code or data.  Only one common (_ID_) is allowed
  15.  to contain data.  If it is used, it is declared separately in the
  16.  source of the particular segment.  The _ID_ common data is read but
  17.  otherwise ignored by NZCOM.
  18.  
  19.  
  20.            Assembly Notes for ZCPR3 modules and NZ-COM
  21.                           by Joe Wright
  22.                            26 March 88
  23.  
  24. NZ-COM uses MicroSoft or SLR .REL modules to build the  Z-System.  
  25. The  modules  are written so as to 'stand alone'.  There  are  no 
  26. direct  inter-module  references.  Rather the modules  treat  the 
  27. ZCPR3   environment  and  obtain  required  data  and   addresses 
  28. indirectly.    The  environment  descriptor  now   includes   the 
  29. addresses of the CBIOS, CCP, DOS and BIOs. as follows:
  30.  
  31. Z3ENV+
  32. 0000      DB   0C3H      ; As always..
  33. 0001      DW   CBIOS     ; For NZ-COM, this is CBIOS+6
  34.  
  35. 0008      DB   80H       ; Env Type.  bit 7 means 'Extended'
  36.  
  37. 0034      DW   DRVEC     ; Valid drive vector allows 'holes'
  38.  
  39. 003F      DW   CCP       ; Address of ZCPR3
  40. 0041      DB   CCPS      ; Its size in records (normally 16)
  41. 0042      DW   DOS       ; Address of the disk operating system
  42. 0044      DB   DOSS      ; Its size (normally 28 records)
  43. 0045      DW   BIO       ; Address of NZBIO (no size)
  44.  
  45.  
  46.                         Notes on Assembly
  47.  
  48. NZ-COM  uses Named COMMON blocks to provide direct references  to 
  49. the  'minor'  segments,  Z3ENV,  SHSTK,  Z3MSG,  etc.   The  file 
  50. Z34CMN.LIB replaces Z3BASE.LIB for all assemblies.  All files are 
  51. assembled  to .REL (MicroSoft or SLR).  NZCOM.COM  also  requires 
  52. the modules to be specifically named.  This is accomplished  with 
  53. the NAME pseudo-op as follows:
  54.  
  55.      NAME      ('CCP')        ; Declare module name
  56.      MACLIB    Z34CMN.LIB     ; In place of Z3BASE.LIB
  57.      MACLIB    Z34HDR.LIB     ; Configuration header
  58.  
  59. Assembly conditionals are treated a little differently.   Because 
  60. module  addresses  are no longer assigned at  assembly  time,  we 
  61. cannot  use the address as an existence test, rather we  use  the 
  62. module 'size' indicator.  The old IF FCP NE 0 test is changed  to 
  63. IF  FCPS NE 0.  FCPS is defined in Z34CMN.LIB as an absolute  YES 
  64. or NO.  Of course, the same holds true for RCP, IOP and Z3NDIR.
  65.  
  66. Because  they  are defined in Z34CMN.LIB,  direct  references  to 
  67. Z3ENV,  SHSTK,  Z3MSG,  Z3CL and the like  are  still  permitted.  
  68. Addresses  and  sizes of the dynamic segments  must  be  obtained 
  69. indirectly  from Z3ENV.  Instead of LD HL,FCP we use LD  HL,(FCP) 
  70. which is defined in Z34CMN.LIB as Z3ENV+18.
  71.  
  72.                         End of NZASM.NOT
  73.  
  74.  
  75. ~
  76.  
  77.  
  78. ; As a replacement for Z3BASE.LIB, some usual equates.
  79.  
  80. base    equ    0        ; Base Page
  81.  
  82. false    equ    0
  83. true    equ    not false
  84.  
  85. no    equ    false
  86. yes    equ    true
  87.  
  88. off    equ    false
  89. on    equ    true
  90.  
  91. ; Named COMMON declarations start here.  For compatibility, these
  92. ; are the same names used by Bridger Mitchell's JetLDR.
  93.  
  94.     common    /_ENV_/
  95. z3env:                ; Z3 Environment descriptor
  96. z3envs    equ    yes        ; There is one
  97.  
  98. expath    equ    z3env+9        ; Address of External Path
  99. expaths    equ    10        ; Maximum 10 elements for MPATH
  100.  
  101. rcp    equ    z3env+12    ; Address of RCP
  102. rcps    equ    yes        ; Used as existence test, not size
  103.  
  104. fcp    equ    z3env+18    ; Address of FCB
  105. fcps    equ    yes        ; Used as existence test, not size
  106.  
  107. z3ndir    equ    z3env+21    ; Address of NDR
  108. z3ndirs    equ    yes        ; Used as existence test, not size
  109.  
  110. z3quiet    equ    z3env+28h    ; Quiet flag ( 1= quiet )
  111.  
  112. z3whl    equ    z3env+29h    ; Wheel byte address
  113. z3whls    equ    yes        ; There is a wheel
  114.  
  115. drvec    equ    z3env+52    ; Valid drive vector
  116.  
  117. ccp    equ    z3env+63    ; CCP entry
  118. ccps    equ    z3env+65    ; Size
  119.  
  120. dos    equ    z3env+66    ; DOS entry (+6)
  121. doss    equ    z3env+68    ; Size
  122.  
  123. bio    equ    z3env+69    ; BIO entry
  124.  
  125.     common    /_SSTK_/
  126. shstk:                ; Top of Shell stack
  127. shstks    equ    yes        ; There is a shell stack
  128.  
  129.     common    /_MSG_/
  130. z3msg:                ; Message buffer
  131. z3msgs    equ    yes        ; There is one
  132.  
  133.     common    /_FCB_/
  134. extfcb:                ; External file control block
  135. extfcbs    equ    yes        ; There is one
  136.  
  137.     common    /_MCL_/
  138. z3cl:                ; Multiple command line
  139. z3cls    equ    yes        ; There is one
  140.  
  141.     common    /_XSTK_/
  142. extstk:                ; External stack
  143. extstks    equ    yes        ; There is one
  144.  
  145.     common    /_BIOS_/
  146. bios:
  147.  
  148.     cseg            ; Select Code Segment
  149.  
  150. ; End of Z34CMN.LIB
  151. 
  152. fcp    equ    z3env+18    ; Address of FCB
  153. fcps    equ    yes        ; Used as existence test, not size
  154.  
  155. z3n