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 / CPM / BDOS / NOVADOSI.LBR / NDOSHDR.LZB / NDOSHDR.LIB
Text File  |  2000-06-30  |  17KB  |  385 lines

  1. ;
  2. ; NOVADOS Disk Operating System Header
  3. ; The current version/release designation of NovaDOS is:
  4. version     macro
  5.         defb    'I    '        ; Current version/release
  6. ;            |.....|        ; MUST be 5 bytes long
  7.         endm
  8.  
  9. ; ASSEMBLY INSTRUCTIONS:
  10. ; ======================
  11. ; This code is written to assemble with either the SLR assembler  Z80ASM  or 
  12. ; with  Microsoft's  M80.   The  former  assembler is highly recommended for 
  13. ; speed and versatility.
  14. ;    
  15. ; All user equates are  contained  in  this  file  which  is  'included'  in 
  16. ; NOVADOS.Z80.   If  assembling  a  relocatable  file  for  NZCOM,  the file 
  17. ; Z34CMN.LIB must be available in  the  current  directory.   If  assembling 
  18. ; absolute  code, the code addresses may be set either in the header file or 
  19. ; taken from the file Z3BASE.LIB.  
  20.  
  21.  
  22.  
  23. ; ASSEMBLY OPTIONS AND ADDRESSES:
  24. ; ===============================
  25. ;
  26. ; If you set z33adr or intadr true, you will want to instruct your assembler 
  27. ; to produce a binary (COM) or HEX file with its absolute  origin  at  100h.  
  28. ; The  code will be .phased to operate at the appropriate address and can be 
  29. ; loaded into PUTSYS, written directly to system tracks or  handled  in  any 
  30. ; manner  consistent with this format.  If cmnadr is set true, then you must 
  31. ; instruct your assembler to produce a REL file.  This file  can  be  loaded 
  32. ; directly  into  memory  using  Alpha Systems' NZCOM or JetLDR.  If you are 
  33. ; using the latter option, the filename extension should be changed to ZRL.
  34.  
  35. ; Set one of the following four equates true:
  36. intadr        defl    false    ; True if setting BIOS base address here
  37. z33adr        defl    false    ; True if using Z3BASE.LIB for system address
  38. cmnadr        defl    true    ; True if assembling zrl file for NZCOM
  39. reladr        defl    false    ; True if generating REL file for SPR/PRL
  40. ;
  41. ; If intadr is true, then the next three equates must be correctly set.
  42. ;
  43. idosloc        equ    8000h        ; Run time start of bdos
  44. ip2bios        equ    0de00h        ; Run time start of BIOS
  45. ramlow        equ    00000h        ; Start address of memory
  46. ;
  47. ; If either intadr or z33adr are true, you may assemble to  a  HEX  file  to 
  48. ; load  into  PUTSYS with MLOAD, ZSID or DDT.  Set hexgen true to enable the 
  49. ; creation of a HEX file with it's origin at PUTSDOS.
  50. hexgen        equ    false        ; True to include PUTSYS DOS origin
  51. ;
  52. putsdos        equ    1180h        ; Location of DOS image in PUTSYS.
  53.                     ; This is fairly universal
  54.  
  55.  
  56. ; FEATURE OPTIONS
  57. ; ===============
  58. ; Not  all of the options below can be implemented at one time.  The size of 
  59. ; the CP/M DOS is limited by many conventions to  3.5K,  although  this  may 
  60. ; change  in  the  near  future  as  Z  system  implementations  become more 
  61. ; flexible. Image size statistics are printed  on  the  screen  following  a 
  62. ; successful assembly and you may adjust the options below accordingly.
  63.  
  64.  
  65.  
  66. ; Reset Disk System Call
  67. ; ----------------------
  68. ;  
  69. ; Some systems, like the Kaypro 10, only recognize  changes  between  single 
  70. ; and  double  sided  disks when the system is warm booted; BDOS function 13 
  71. ; (reset disk) will not work.  There are two  solutions  to  this  situation 
  72. ; which  we shall call "The AXE" and "The SCALPEL".  Both are effective, but 
  73. ; the latter is preferable for it's intelligence.   Note  that  if  you  are 
  74. ; using  Advent  Products'  TurboROM  you do not need to use EITHER of these 
  75. ; methods.  Disk format determination is done automatically with  each  disk 
  76. ; reset if the  disk has been changed.  If you  are using the  TurboROM, set 
  77. ; resdsk FALSE.
  78. ;
  79. ; *** The AXE:
  80. ; By  adding  a  "hook"  to  the BIOS of machines supporting multiple floppy 
  81. ; formats and setting resdsk true and resflag false BDOS  function  13  will 
  82. ; allow  changes between single and double sided disks.  Very handy for disk 
  83. ; housekeeping utilities such as nswp, nulu, and cataloging programs.  
  84. ;  
  85. ; The "hook" is added as follows: obtain the source to your computer's BIOS.  
  86. ; examine  the  code  for warm boot.  Somewhere, there should be a call to a 
  87. ; routine which initializes the disk system after  a  warm  boot,  or  which 
  88. ; detects  changes between single and double sided disks.  Call this routine 
  89. ; diskint for purposes of discussion.  Modify your BIOS's cold boot  routine 
  90. ; to  initialize 3 bytes at address setdsk as "jp diskint".  The location of 
  91. ; setdsk is arbitrary, it may be in your BIOS, or  in  a  reserved  spot  in 
  92. ; CP/M's page 0.
  93. ; *** The SCALPEL:
  94. ; On some systems which support more than one disk  format,  a  single  byte 
  95. ; controls  the  resetting  of the floppy format.  This byte, which we shall 
  96. ; call the resflag, when initialized by diskint (see "The  AXE")  tells  the 
  97. ; floppy  drive  support  routines  to  invoke a subroutine to determine the 
  98. ; floppy disk format.  If you know the location and  appropriate  value  for 
  99. ; the  resflag  you  may reset it directly from within NovaDOS.  This method 
  100. ; has the advantage that it does  not  generally  result  in  unlogging  the 
  101. ; permanent  media  and  so  can  be  used in the NovaDOS disk login routine 
  102. ; rather than in the disk reset (Function 13) routines, allowing the  floppy 
  103. ; format to be tested and reset more easily without the necessity of logging 
  104. ; in all the drives anew each time resdsk is called.
  105. ; Finding  the  resflag generally requires that you have the source code for 
  106. ; your ROM or do some sleuthing in the ROM scratch  area.   A  good  way  of 
  107. ; locating  the resflag is to use a debugger to save the ROM scratch area to 
  108. ; a file.  Save one file with the floppy at SSDD, one  with  the  floppy  at 
  109. ; DSDD  and one after a warmboot with the floppy logged out.  Use DI or COMP 
  110. ; or any good binary file  comparitor  to  locate  the  bytes  which  differ 
  111. ; between  these  files.   A  little  experimentation should lead you to the 
  112. ; address which you can POKE with a value which will cause the floppy format 
  113. ; to be reevaluated. Look in particular for bytes which change value between 
  114. ; 0ffh and some low value such as 00, 01 or 02.  If you have a  system  with 
  115. ; more  than  one  multiple format floppy you may have to modify the NovaDOS 
  116. ; code to correctly handle your situation.  The code, which is  executed  in 
  117. ; NVDS-2.Z80, is included below as a macro for your convenience.
  118. ; Set resdsk true if using either the AXE or the  SCALPEL.   If  your system 
  119. ; doesn't  support multiple floppy formats you may set resdsk false and save 
  120. ; some code.
  121. ;
  122. resdsk        equ    false        ; Reset disk enabled.  Set this 
  123.                     ; true if using either the AXE or 
  124.                     ; the SCALPEL
  125. ;    
  126. resflag        equ    true        ; True if using the SCALPEL
  127.                     ; False if using the AXE 
  128.  
  129. ; If  resflag  is  TRUE  (i.e.,  using  the SCALPEL) set resflag_loc the the 
  130. ; address of the byte which tells the BIOS whether or not  the  floppy  disk 
  131. ; format has been determined.  Set resflag_val to the value which will cause 
  132. ; the BIOS to reevaluate the floppy disk format.
  133. resflag_loc    equ    0fd31h        ; Address of format flag
  134. resflag_val    equ    0ffh        ; Value of flag to reset format
  135.  
  136. ; If  resflag  is  FALSE  (i.e., using the AXE) set setdsk to address of the 
  137. ; routine (or address of a jump to the routine)  in  your  BIOS  which  will 
  138. ; initialize your disk hardware
  139. setdsk        equ    0050h        
  140.  
  141. ; This is the code which executes if resflag is true.  Modify this code with 
  142. ; care or not at all.  All registers are available for use if necessary.  If 
  143. ; it works, DON'T fix it.
  144. rflgmac        macro
  145.         ld    hl,resflag_loc        ; Reset DSDD/SSDD flag in BIOS
  146.         ld    (hl),resflag_val
  147.         endm
  148.  
  149.  
  150.  
  151. ; DOS path
  152. ; --------
  153. ; NovaDOS  implements  a  file search path similar to the ZCPR3 search path.  
  154. ; NovaDOS will locate all system and public files  along  the  path  and  is 
  155. ; useful for locating overlays and other support files for non-ZCPR programs 
  156. ; in either a ZCPR or CP/M environment.  The initial address of the path  is 
  157. ; contained  in  a buffer near the start of NovaDOS and if pathcall is true, 
  158. ; Function 42 is available to get and set the path address.  If DE is  0  on 
  159. ; call  to  Function 42 then the path address is returned in HL.  Otherwise, 
  160. ; the path address is set to the value of DE.
  161. ispath        equ    true        ; TRUE to incorporate path support
  162.                     ; code in NovaDOS.  If you don't 
  163.                     ; want path support you may save
  164.                     ; c.a. 110 bytes of code by setting
  165.                     ; ispath FALSE.
  166. ;
  167. pathoff        equ    0000h        ; Location of path in memory
  168.                     ; Set this to 0 to disable the
  169.                     ; DOS path at run time.
  170. ;
  171. pathcall    equ    true        ; True to  include Function 42
  172.                     ; to manipulate the path address
  173.  
  174.  
  175. ; Time and Date support
  176. ; ---------------------
  177. ; NovaDOS  contains  support for Time/Date stamping of files.  If you have a 
  178. ; clock/calendar and you wish to implement time and date  stamping  you  may 
  179. ; set  this  equate  true to include the DOS routines in the assembly.  Time 
  180. ; and date information is additionally available via Function calls 200  and 
  181. ; 201,   as  discussed  in  NOVADOS.DOC.   The  format  for  time  and  date 
  182. ; information is also explained therein.
  183. dotime        equ    false        ; True if time-stamping is supported 
  184. timeoff        equ    0000        ; Offset of time routine in BIOS
  185.  
  186.  
  187. ; Rewrite Console Buffer Line
  188. ; ---------------------------
  189. ; CP/M  BDOS  will  rewrite  the  console  buffer on the screen if ctrl-R is 
  190. ; entered during buffer input.  This is a very "old fashioned" facility  and 
  191. ; functions mainly to compensate for the nerdish behavior of the delete key.  
  192. ; The improved delete key routine in  NovaDOS  allows  this  feature  to  be 
  193. ; eliminated  will  little  loss  in versatility.  Significant code space is 
  194. ; saved.  It is recommended that this equate be left false.
  195. contron        equ    false        ; False to eliminate Ctrl-R
  196.  
  197.  
  198. ; Reset unlogged disks
  199. ; --------------------
  200. ; A ZRDOS Function 13 call will not reset the Read Only vector.   Similarly, 
  201. ; a  call to ZRDOS Function 37 will reset the Read Only status of only those 
  202. ; drives specified in the bit map passed in de.  A  CP/M  function  37  call 
  203. ; will unprotect ALL drives not currently logged in.  Setting this equate to 
  204. ; false will make Function 37 emulate ZRDOS for programs which require it.
  205. runlog        equ    false        ; False to NOT reset the read only
  206.                     ; vector with Funcs. 13 and 37
  207.  
  208.  
  209. ; ZRDOS High Functions
  210. ; --------------------
  211. ; ZRDOS provides five additional DOS  functions  which  are  employed  by  a 
  212. ; variety of Z system software.  These functions are:
  213. ;       Function 39:    Return Permanent Media Bit Map
  214. ;     Function 47:    Return Current DMA Address
  215. ;     Function 48:    Return ZRDOS Version Number
  216. ;     Function 50:    Set Warm Boot Trap
  217. ;     Function 51:    Reset Warm Boot Trap
  218. ; These  functions  are  included  in NovaDOS if the following equate is set 
  219. ; true. 
  220. hifuncs        equ    true        ; True to include ZRDOS high 
  221.                     ; Functions 
  222. ; ZRDOS Version Number
  223. ; --------------------
  224. ;
  225. ; If hifuncs is true, NovaDOS will return a pseudo ZRDOS version number from 
  226. ; a Function 48 call.  ZRDOS compatible programs make this call to determine 
  227. ; whether or not ZRDOS is running.  ZRDOS versions emulated by NovaDOS range 
  228. ; up  to  1.9.  The  equate below probably will not have to be changed until 
  229. ; and unless ZRDOS is upgraded and software is written which requires higher 
  230. ; version numbers.
  231. zrvers        equ    0019h        ; ZRDOS version number returned by
  232.                     ; Function 48
  233.  
  234.  
  235. ; Error Escaping
  236. ; --------------
  237. ;
  238. ; You  may choose to ignore NovaDOS error messages relating to R/O files and 
  239. ; disk write errors by hitting a key of your choice.  If a file R/O  message 
  240. ; is  ignored,  the  file  will  be treated as R/W.  If a disk read error is 
  241. ; ignored, another attempt will be made to read the disk.  The  key  defined 
  242. ; below  will be your error ignore key.  If you set this key to 0, the error 
  243. ; ignore feature will be omitted from the assembly with a small  savings  in 
  244. ; code.
  245. erresc        equ    1bh        ; The escape key is a good one here.
  246.                     ; Some people prefer a CR (13h)
  247.  
  248.  
  249. ; High Bits Character Support
  250. ; ---------------------------
  251. ; NovaDOS  can  allow  high  bits  characters to be entered into the console 
  252. ; buffer if they are available  through  the  user's  conin  routine.   This 
  253. ; feature  is  useful  for a variety of software which is keyboard intensive 
  254. ; and which allows user configurable control sequences.   If  your  keyboard 
  255. ; and  BIOS do not make high bit characters available, set this equate false 
  256. ; to save several bytes of code.  If implemented, the acceptance of high bit 
  257. ; characters is under the control of bit 2 of the flags byte.
  258. ; High  bits,  if  present  in  the  data stream, are normally output to the 
  259. ; console during calls to functions 2, 6, 9 and 10.  If hibiton is true then 
  260. ; this feature will be under the control of flags bit 3.  If the bit is off, 
  261. ; high bit output will be suppressed and vice versa.
  262. hibiton        equ    true        ; True to allow control of high
  263.                     ; bit character I/O with flags
  264.                     ; byte
  265.  
  266. ; Initial Flags Settings
  267. ; ----------------------
  268. ; The  flags  byte  controls several functions as detailed below.  It may be 
  269. ; altered using function 41.  P2DOS originally  made  all  public  attribute 
  270. ; files R/O, however this can cause problems with utilities which attempt to 
  271. ; copy them.  Since public files do  not  ordinarily  need  protection  from 
  272. ; erasure,  the  small  savings  in  safety gained by making them R/O is not 
  273. ; worth the possible problems with copy programs and it is advised that this 
  274. ; bit be left unset.  Bit 5, if set, forces a  search of drive A for a file-
  275. ; name  starting  with "$$".  This  takes time, and  warm boots on hard disk 
  276. ; or  other permanent media  systems can be speeded up  considerably if  bit
  277. ; 5 is reset.  If you never  use the submit  facility (or the dBase II "quit
  278. ; to" operation)  you may leave  this bit reset  and enjoy  much faster disk
  279. ; system resets.   
  280. flagbyte    equ    00100011b    ; Initial flag byte setting
  281. ;            ||||||||
  282. ;            ||||||| \public files enabled if set
  283. ;            |||||| \256 character delay if set (see doc file)
  284. ;            ||||| \accept high bits in function 10 if set
  285. ;            |||| \output high bits to screen if set
  286. ;            ||| \make public attribute files R/O if set
  287. ;            || \perform full disk resets on ALL media if set
  288. ;            | \unused
  289. ;             \unavailable
  290.  
  291.  
  292.  
  293. ; External DOS stack
  294. ; ------------------
  295. ; If the options which you have enabled in this header  file  create  a  DOS 
  296. ; which  is larger than 3.5K the "BDOS TOO BIG" message will be displayed on 
  297. ; assembly.  If you have 36 bytes of memory available  elsewhere  in  memory 
  298. ; you  may  assign this block to the DOS stack by setting the exstack equate 
  299. ; to the address of the TOP of this  block.   This  will  leave  more  space 
  300. ; within  NovaDOS  for  code.   Setting exstack to 0 makes the NovaDOS stack 
  301. ; internal.
  302. exstack        equ    0000h        ; Address of TOP of external DOS 
  303.                     ; stack, or 0 for internal stack
  304.  
  305.  
  306.  
  307. ; If you are doing work on NovaDOS and need to do rapid  sequential  assemb- 
  308. ; lies  of  the  source,  you may find it helpful to make use of the .accept 
  309. ; feature of Z80SASM.  Set the following equate TRUE to use .accept.
  310. ;
  311. debug_flag    equ    false    ; To accept information from the console
  312.  
  313.  
  314. ; Code Relocation Function
  315. ; ------------------------
  316. ;
  317. ; NovaDOS contains an optional experimental code relocation function (38) 
  318. ; which will relocate executable code, adjusting address according to an 
  319. ; SPR style bitmap.  See the manual for details of using this function.  The
  320. ; code cost for this function is substantial but it can be implemented if 
  321. ; the DOS stack is made external and pathcall and hibiton are false.  
  322. relfunc        equ    false    ; True to include code relocation function
  323.  
  324.  
  325. ; END OF USER DEFINED EQUATES  ..............................
  326. ; -----------------------------------------------------------
  327.  
  328.  
  329. ; The following should not change unless you are debugging a new NovaDOS
  330. ;
  331.         if     debug_flag
  332.  
  333.         .accept    'Creating low-load version? ', bugval
  334.         if    bugval
  335. intadr        defl    true
  336. cmnadr        defl    false
  337. reladr        defl    false
  338.         endif
  339.         endif
  340.  
  341. ;
  342. ; End of file
  343. ; -----------