<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 28 Aug 1982 17:11:00-EDT
From   : Keith Petersen <W8SDZ@Mit-Mc>
Subject: Undocumented CP/M trap

---forwarded from my RCPM system, please reply to address below---

August 12, 1982

TO: All CP/M assembly programmers
FROM: Thomas Hill
      200 Oklahoma
      Anchorage, Ak.  99504
      (907) - 337-1984

   SUBJECT: Undocumented CP/M BDOS Features

Just a short note to aquaint you with an "undocumented feature" I have 
encountered in the CP/M 2.2 BDOS.  While developing an assembly program 
which read and wrote disk files, an early version did not open the 
output file before writing to it.  Oddly enough, the BDOS accepted the 
write and did not return an error condition.  Being a curious soul
(and cautious), I sidetracked to investigate this effect.  A call to 
Digital Research resulted in a letter informing me that they knew of the 
effect and told me it was an "undocumented feature" of CP/M.  They also 
told me that it was the programmer's responsibility to open and close 
his files properly, to which a heartily agree.
However.  I wrote some test programs to determine WHERE on the disk the 
information was going, and WHAT happened to the valid data on the disk.
Writing to an unopened file apparently writes information beginning at 
Group 0, sector 1 and continues in a sequential manner thru the 
allocation map.  (I lost three directories that way).  No change is made 
in the allocation map, however, and the only change in the File Control 
Block is the Current Record and Next Record fields are incremented.  NO
CHANGE occurs in the FCB allocation map.

While it is, of course, the programmer's responsibility to control the 
file accesses, and proper opening and closing is mandatory, in some 
cases (particularly during program development), proper file access may 
not take place.  If this occurs, a possible loss of data may result.
There may be a BDOS patch which will clear this up, or someone out there 
may already have one.  If anyone knows more about this, I would 
appreciate it if you would drop me a line at the above address.

Thanks,
Thomas Hill
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>