home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / dskbuf / ramdisk.lbr / RAMDISK.DQC / RAMDISK.DOC
Encoding:
Text File  |  1985-06-17  |  3.9 KB  |  89 lines

  1.                         A MEMORY RESIDENT
  2.                        FLOPPY DISK PROGRAM
  3.  
  4.                                by
  5.  
  6.                         Michail J. Karas
  7.  
  8.  
  9.  
  10.  
  11.      This   is   from   the  Lifelines/The   Software   Magazine, 
  12. September1982 issue,  about ADD-ON MODULE Construction. An add-on 
  13. module  is designed for use under single user  CP/M-80  2.2.  The 
  14. next several paragraphs, from the previous articles, January, and 
  15. February  1982,  show  the  procedure  to get a  version  up  and 
  16. running.
  17.  
  18. The source file,  RAMDISK.ASM,  being very similar to a BIOS  for 
  19. CP/M-80 2.2, requires the extension disk definitions to have disk 
  20. parameter  tables,   check  vector  and  allocation  vectors.  In 
  21. addition,  a directory buffer must be allocated. An ADD-ON MODULE 
  22. generates  the  appropriate tables through the use of  the  macro 
  23. library  DISKDEF.LIB provided by Digital Research on the  CP/M-80 
  24. 2.2 distribution diskette. This macro capability requires a macro 
  25. assembler to properly process the DISKDEF macros.
  26.  
  27. An  additional implementation requirement is the availability  of 
  28. the  assembler  output  as  a .REL  file.  The  Digital  Research 
  29. Relocating  Macro Assembler RMAC is just the tichet  to  generate 
  30. the  appropriate  .REL  file and process  the  DISKDEF.LIB  macro 
  31. includes.  The  command structure below shows how to assemble  an 
  32. ADD-ON  MODULE program like the RAM disk demo listing on the disk 
  33. as RAMDISK.ASM. The following is an example on the assembly.
  34.  
  35.      A>RMAC RAMDISK $+S PZ<cr>
  36.  
  37. The resulting .REL file has to be converted to a page relocatable 
  38. format.  After agonizing over the problem of easily making a "BIT 
  39. MAP",  I found that the Digital Research Link program distributed 
  40. with  RMAC and PL/I-80 can generate page relocatable files  (.PRL 
  41. type) which are compatible with MP/M-80. After reviewing the LINK 
  42. output format of a .PRL file,  I designed the PRLMOVE program  to 
  43. relocate the LINK output files. The command structure below shows 
  44. how to produce the required .HEX file from PRLMOVE.
  45.  
  46.      A>MAC PRLMOVE $+S PZ<cr>
  47.  
  48. The  command  structure below shows how to produce the .PRL  file 
  49. from the RMAC output.
  50.  
  51.      A>LINK RAMDISK[OP]<cr>
  52.  
  53. where  [OP] directs LINK to generate the desired .PRL  file.  The 
  54. program PRLMOVE.HEX and the page relocatable RAMDISK.PRL must  be 
  55. combined into a single executable command file as follows:
  56. A>DDT<cr>
  57. DDT Vers. 2.2
  58. -IRAMDISK.PRL<cr>
  59. -R<cr>                   <-Load  of .PRL file to RAM to  address 
  60.                            0100H  with  code image  starting  at 
  61.                            address 0200H.
  62. MEXT PC
  63. nnmm  0000               <-Convert nn to decimal  and  remember 
  64.                            value.
  65. -IPRLMOVE.HEX<cr>
  66. -R<cr>                   <-Read  PRLMOVE program in  over  the 
  67.                            .PRL file at load address of 0100H.
  68. -G0<cr>                  <-Exit DDT to CP/M-80.
  69.  
  70. A>SAVE dd RAMDISK.COM    <-Save dd pages of memory to get command 
  71.                            file. dd = converted nn from above!
  72.  
  73. This  results  in  the  .COM command file necessary  to  make  an 
  74. executable module out of the ADD-ON MODULE.
  75.  
  76. The present design of the ADD-ON MODULE with the negative  offset 
  77. pointer calculation reentry to CCP requires that the BDOS and CCP 
  78. combination  be genuine (REAL Digital Research CP/M-80 Ver 2.2 of 
  79. total length 01600H bytes. If your system uses a modified BDOS or 
  80. CP/M-80 system look-alike,  then the negative offset to the stack 
  81. pointer will require a different value. See NOT$PRES: in listing. 
  82. Also,  for non-genuine CP/M-80 systems, if the CCP is a different 
  83. size  (not  0800H)  bytes,  the program PRLMOVE will have  to  be 
  84. modified  to set down the relocation load address calculation  by 
  85. an amount equal to the difference in the alien CCP size.
  86.  
  87.  
  88.  
  89.