home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / kaypro / kprolist.bug < prev    next >
Text File  |  1984-01-19  |  1KB  |  39 lines

  1.  
  2.  
  3.  
  4.  #: 74332      Sec. 1 - General
  5. Sb: #Kaypro Mystery Solved
  6.     18-Jan-84  01:54:26
  7. Fm: JACK CRENSHAW 72325,1327
  8. To: All
  9.  
  10. Some time ago I reported a problem with the MDM711/Kaypro/Epson combina-
  11. tion, in that the ^P print buffer dropped characters.  Periodically, the
  12. subject has come up again, with Irv Hoff and Pete Holsberg trying hardest
  13.  
  14. to help me solve the problem.  I finally got around to looking at the
  15. Kaypro BIOS, and as Pete suspected, there's a bug. The offending piece
  16. of code is in the ROM, and goes:
  17.  
  18.      LISTST:  IN     1CH        ;GET SYSTEM PORT
  19.               BIT    3,A       ;TEST PRINTER READY BIT
  20.               RZ            ;THIS IS THE BUG
  21.               MVI    A, 0FFH    ;ELSE RETURN FF
  22.               RET
  23.  
  24. Note that if the bit 3 is zero, the routine returns garbage in A. The
  25. garbage is whatever is in port 1CH, which includes output as well as
  26. input bits.  However, the zero FLAG is set properly, which is why BIOS
  27. function 4 (LIST) works OK.  Ironically, if the programmer had used the
  28. usual ANI insruction instead of the Z-80 fancy bit test, he would have
  29. saved two bytes as well as get the right response.  The bug is in the
  30. ROM, so can't be easily fixed. The patch is easy, though -  Change the
  31. jump vector in the BIOS to:   JMP PATCH   and add:
  32.  
  33.      PATCH:  CALL    0FB65H    ;call old bios entry
  34.              RNZ        ;OK unless its zero
  35.              XRA     A        ;else clear A
  36.              RET        ;that's all, folks
  37.  
  38.                     - Jack Crenshaw
  39.