home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / MCB.ZIP / MCB_READ.ME next >
Encoding:
Text File  |  1988-11-25  |  2.0 KB  |  41 lines

  1. -------------------- TYPIST NOTES -------------------
  2.  
  3.    See remarks in MCB.C to see where this program comes from. The files
  4. on this disk associated with MCB.C are MC*.*. There have been corrections
  5. added to the original MCB.C to get it to work. They appear below:
  6.  
  7. 1. The statement in main():
  8.    ptrmcb = (PTRMCB)(((unsigned long)(ptr->psize + 1) << 16) + ptrmcb);
  9.    was originally:
  10.    ptrmcb += ptrmcb->psize + 1;
  11.    The original statement added to the offset instead of to the segment
  12.    of ptrmcb and hence the change.
  13. 2. A variable, 'escape', was added to code in prn_pid_own() to escape from
  14.    the while (envsize) loop. The while was changed to:
  15.    while (envsize && escape)
  16. 3. Also in prn_pid_own(), the statement:
  17.    if (!*envptr && *(envptr + 2) == 0x1)
  18.    was originally:
  19.    if (!*envptr && *(unsigned far *) (envptr + 1) == 0x1)
  20. 4. Also in prn_pid_own(), the statement:
  21.    envptr += 4;
  22.    was originally:
  23.    envptr += 3;
  24.    and the statement: escape = 0; was added.
  25.  
  26.    I used Power C to compile and link MCB.C. Although I have provisions in
  27. MCB.C to compile with Quick C, it will not work after it's compiled and 
  28. linked. I suspect a compiler bug. Quick C insists on making the MCB structure 
  29. 18 bytes instead of 16 bytes as required. This wreaks havoc on the pointer 
  30. arithmetic to chain through the MCB's. Also, although the structure's first 
  31. element is a char, Quick C increments by 2 instead of 1 when the second 
  32. element (an unsigned int) is accessed giving the wrong value. This seems to 
  33. matter only with an existing structure in memory (which the MCB is) and a 
  34. structure is declared to match it. A structure declared and filled with 
  35. assignment statements still increments a char by 2 but the correct value is 
  36. returned when accessing the unsigned int following.
  37.  
  38.    As noted in the MCB.C notes, the small model is used to compile. However, 
  39. with Power C I don't think it matters which command line switch is used. I have 
  40. never gotten them to work.
  41.