home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpminfo / undoccpm.doc < prev    next >
Text File  |  1994-07-13  |  2KB  |  42 lines

  1.  
  2. August 12, 1982
  3.  
  4. TO:   All CP/M assembly programmers
  5. FROM: Thomas Hill
  6.       200 Oklahoma
  7.       Anchorage, Ak.  99504
  8.       (907) - 337-1984
  9.  
  10. SUBJECT: Undocumented CP/M BDOS Features
  11.  
  12. Just a short note to aquaint you with an "undocumented feature" I have 
  13. encountered in the CP/M 2.2 BDOS.  While developing an assembly program 
  14. which read and wrote disk files, an early version did not open the 
  15. output file before writing to it.  Oddly enough, the BDOS accepted the 
  16. write and did not return an error condition.  Being a curious soul
  17. (and cautious), I sidetracked to investigate this effect.  A call to 
  18. Digital Research resulted in a letter informing me that they knew of the 
  19. effect and told me it was an "undocumented feature" of CP/M.  They also 
  20. told me that it was the programmer's responsibility to open and close 
  21. his files properly, to which a heartily agree.
  22.  
  23. However.  I wrote some test programs to determine WHERE on the disk the 
  24. information was going, and WHAT happened to the valid data on the disk.
  25. Writing to an unopened file apparently writes information beginning at 
  26. Group 0, sector 1 and continues in a sequential manner thru the 
  27. allocation map.  (I lost three directories that way).  No change is made 
  28. in the allocation map, however, and the only change in the File Control 
  29. Block is the Current Record and Next Record fields are incremented.  NO
  30. CHANGE occurs in the FCB allocation map.
  31.  
  32. While it is, of course, the programmer's responsibility to control the 
  33. file accesses, and proper opening and closing is mandatory, in some 
  34. cases (particularly during program development), proper file access may 
  35. not take place.  If this occurs, a possible loss of data may result.
  36. There may be a BDOS patch which will clear this up, or someone out there 
  37. may already have one.  If anyone knows more about this, I would 
  38. appreciate it if you would drop me a line at the above address.
  39.  
  40. Thanks,
  41. Thomas Hill
  42.