home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / DRI-archive / roche / Z80LIB.TXT < prev    next >
Internet Message Format  |  2009-12-11  |  7KB

  1. From: French Luser <Gary.Kild...@Digital.Research.com>
  2. Newsgroups: comp.os.cpm
  3. Subject: To count one's Z80.LIB files...
  4. Date: Sat, 09 Sep 2006 13:47:54 +0200
  5. Message-ID: <65a5g2lv8emjmit23g7hteetr17i0hht30@4ax.com>
  6. References: <44f6f883$1@news.starhub.net.sg> <perif2p5r2hq3top2k5ufhgguavv4m8c2j@4ax.com> <44fa4d8c@news.starhub.net.sg> <kpyKg.6304$rT5.5190@fed1read01> <44feee00@news.starhub.net.sg> <45012296$0$5103$ba4acef3@news.orange.fr>
  7. X-Newsreader: Forte Free Agent 3.3/32.846
  8. MIME-Version: 1.0
  9. Content-Type: text/plain; charset=us-ascii
  10. Content-Transfer-Encoding: 7bit
  11. X-Antivirus: avast! (VPS 0636-3, 08/09/2006), Outbound message
  12. X-Antivirus-Status: Clean
  13. Lines: 127
  14. Organization: les newsgroups par Orange
  15. NNTP-Posting-Date: 09 Sep 2006 13:47:55 CEST
  16. NNTP-Posting-Host: 80.11.68.242
  17. X-Trace: 1157802475 news.orange.fr 27411 80.11.68.242:63693
  18. X-Complaints-To: abuse@orange.fr
  19.  
  20. Z80LIB.TXT
  21. ----------
  22.  
  23. "To count one's Z-80.LIB files (before they are assembled)"
  24. by Emmanuel ROCHE
  25.  
  26. Ok. So, it was expected that, tonight, I  would finally  be able 
  27. to answer the interesting question of Yong Lak: "Is it  possible 
  28. to emulate M80's PHASE and DEPHASE pseudo-ops under RMAC?"
  29.  
  30. Unfortunately, I had a problem with the computer  that I  use to 
  31. write my messages to the comp.os.cpm Newsgroup (using WordStar 4 
  32. or VDE for TXT files), so I gave it to a computer shop. One week 
  33. later, I got it  as planned...  except that  the hard  disk (the 
  34. most important piece of the computer) was no  longer working  as 
  35. expected! So, tonight, I spent a good deal of time debugging the 
  36. hardware,  a  thing  that  I  rarely  do, prefering  to give  my 
  37. computers  to  a friend  of mine,  who is  the most  experienced 
  38. electronician that I know.
  39.  
  40. Unfortunately, this time, I had not  enough time  (he lives  500 
  41. kilometers  away),  so  I  was obliged  to do  it myself.  After 
  42. erasing the  Windows and  MS-DOS directories,  installing DR-DOS 
  43. 7.03,  and  playing  with  FDISK  and  VDISK, I  finally have  a 
  44. computer... but is it working? (It would be a pity  to lose  all 
  45. my files...)
  46.  
  47. Let  us  review  the  problem.  Among  other  things,  Yong  Lak 
  48. published his boot code. So, I retyped it.
  49.  
  50. It was containing 2 MACLIB pseudo-ops (some other assemblers use 
  51. INCLUDE). One was involving Z80.LIB, the  well-known library  of 
  52. macros from Digital Research enabling MAC  and RMAC  to generate 
  53. Z-80 code like LDIR (MAC and RMAC are  both 8080  assemblers, as 
  54. is  M80).  The  second  was named  JR180: obviously  some macros 
  55. dealing with the Z80S180,  since the  code was  containing names 
  56. such as CBAR, BBR, and CBR. (Not much comments, yong!)
  57.  
  58. So, I said: "Easy, find a  copy of  Z80.LIB, then  assemble with 
  59. dummy CBAR, BBR, and CBR values,  then write  the message.  What 
  60. could be simpler?"
  61.  
  62. So, to  check if  my computer  was running  correctly, I  typed: 
  63. "find z80.lib" at the system's prompt.  (I must  explain that  I 
  64. don't use  the standard  MS-DOS FIND  (searching for  strings in 
  65. files) but a FINDFILE program because (according to  the system) 
  66. there are 18,000 files  in 900  directories.  The  computer shop 
  67. owner told me that I was his record  holder: normally,  he deals 
  68. with  companies  which only  have one  accounting program  under 
  69. Windows.  He had never seen before  an individual  with so  many 
  70. programming  languages  and  documents  in  his  computer.   And 
  71. everything  in  characters,  not  huge  giant,  inefficient  PDF 
  72. files...
  73.  
  74. One of those directory  happens to  be the  DRIPAK file  that is 
  75. available on the Internet. FIND also found 2  other copies,  one 
  76. in the BIOS of CP/M Plus for the  North Star  Horizon of  Howard 
  77. Harte, the other in the directory of UNLOAD Version 2.0.
  78.  
  79. C:\DRIPAK\MAC\Z80.LIB              9856 bytes
  80. C:\DRIPAK\MAC-RMAC\Z80.LIB         6016 bytes
  81. C:\DRIPAK\RMAC\Z80.LIB             6016 bytes
  82. C:\DRIPAK\CPM_2-2\SYSTEM\Z80.LIB   9984 bytes
  83. C:\DRIPAK\CPM_3-0\SOURCES\Z80.LIB  5904 bytes
  84. C:\DRIPAK\MPM_2\DRI\Z80.LIB        6016 bytes
  85.  
  86. C:\NSTAR\BIOS3\Z80.LIB             5904 bytes
  87. C:\TEMP\UNLOAD\Z80.LIB             9856 bytes
  88.  
  89. So, big problem: I was expecting to find one Z80.LIB file, and I 
  90. discover, at first sight, at least 4 versions of it!
  91.  
  92. From smallest to biggest:
  93. 5904 bytes (2 copies)
  94. 6016 bytes (3 copies)
  95. 9856 bytes (2 copies)
  96. 9984 bytes (1 copy)
  97.  
  98. So, I copied copies of them  (FIRST.LIB, SECOND.LIB,  etc), then 
  99. compared them with my COMPARE program (what would  I be  able to 
  100. do, without it?). It turns out that:
  101.  
  102. 1) The difference between the 5904-bytes and 6016-bytes files is 
  103. that the 5904-bytes file ends with 00H bytes filling the  "slack 
  104. bytes"  (at  the end  of a  file, after  the CP/M  "end-of-file" 
  105. character), while the 6016-bytes file ends with a  string of  1A 
  106. bytes, filling the next  record. (Those  smaller files  have the 
  107. comments, at the beginning of the  files, removed,  obviously to 
  108. speed assembly. 00H files were probably generated by  a non-CP/M 
  109. editor, while  1AH files  were, obviously,  generated by  a CP/M 
  110. editor.)
  111.  
  112. 2) The difference between the 9856-bytes and 9984-bytes files is 
  113. that  the  9984-bytes  file  contains  a   handful  of   control 
  114. characters that  are not  present in  the 9856-bytes  file. (VDE 
  115. displays control characters on screen, so  it was  very easy  to 
  116. find them and erase  them. Recommended  if you  are still  using 
  117. MS-DOS.  In  addition, VDE  used to  run under  CP/M --  where I 
  118. discovered it.)
  119.  
  120.  
  121. Conclusion
  122. ----------
  123.  
  124. If you are using Z80.LIB to generate Z-80 opcodes using  Digital 
  125. Research's MAC and RMAC, be sure to use the 9856-bytes long file 
  126. (found in the DRIPAK, in the MAC directory -- probably a copy of 
  127. the work disk of Gary Kildall).
  128.  
  129. (Control characters can produce very hard to find  subtle errors 
  130. in macro-assemblers. Me, twenty years ago, I spent several hours 
  131. before discovering that, after typing an "ENDM", I  had typed  a 
  132. "space", before  pressing the  "RETURN" key...  Of course,  this 
  133. space was not appearing when I  was displaying  the source  code 
  134. with ED, or printing the file on my  daisy-wheel printer!  I was 
  135. obliged to dump the file -- fortunately, I  had managed  to find 
  136. where  in  the  listing  things  were   going  wild   --  before 
  137. understanding the source of the bug. So, beware of spaces  after 
  138. "ENDM" pseudo-ops!)
  139.  
  140. Time to go to bed. Maybe this week-end?...
  141.  
  142. Yours Sincerely,
  143. "French Luser"
  144.  
  145.  
  146. EOF
  147.