home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG042.ARK / HOW2BS.DOC < prev    next >
Text File  |  1984-04-29  |  3KB  |  63 lines

  1.  
  2.     HOW TO PATCH CP/M VER 1.4 TO ECHO 'DEL' AS 'BS'
  3.     -----------------------------------------------
  4.  
  5. The patches listed below will allow CP/M to echo the delete function
  6. as a backspace.  Since one of the patches takes advantage of the
  7. jump relative capability of the Z80, THE PATCHES WILL NOT WORK AS
  8. DESCRIBED ON AN 8080 SYSTEM.   However with the info given it will
  9. be simple for an 8080 user to make the appropriate patch that will
  10. function.
  11.  
  12. CAUTION:  I am currently using this patch and to date it has proven
  13. to work well.  It does not work within the 'Insert' mode of the
  14. Editor, but it does work at command level.  I'll leave it to some-
  15. one else to figure out why.  Anyway use it at your own risk.
  16.  
  17. PATCH ONE: The console input routine (12F3H) gets a char and, after
  18. testing for carriage return, tests for 'delete'.  If the test for
  19. 7FH is successful, CP/M gets the counter from Reg B and tests it for
  20. zero.  If true (i.e. we're at start of buffer) a jump is executed
  21. back to the console input routine.
  22.  
  23. If we are not at the start of the buffer, CP/M loads the previous
  24. char (pointed to by HL) into the Acc and jumps to the CONOUT rout.
  25. Since we want to echo a backspace instead of the previous char,
  26. replace the MOV A,M with MVI A,08 (or whichever character it is that
  27. your terminal treats as a backspace).  The extra memory location
  28. required by the MVI instruction is recovered by replacing the
  29. JZ XX73 with JR Z,E9.  More precisely:
  30.  
  31. LOC IN TPA AFTER        ORIGINAL MACHINE CODE      REPLACED BY
  32.      SYSGEN
  33. ----------------        ---------------------      -----------
  34.     1308                    CA XX 73 7E            28 E9 3E 08
  35.  
  36.  
  37. PATCH TWO: CP/M will convert any character less than 20 hex to
  38. its Ascii equivalent preceeded by '^'.  All except CR, LF, and
  39. TAB that is.  To enable our backspace character to be echoed
  40. unchanged, we insert a patch at the start of the conversion
  41. routine to test for '08' and exit if true.  Again in the TPA:
  42.  
  43. LOC IN TPA AFTER        ORIGINAL MACHINE CODE       REPLACED BY
  44.      SYSGEN
  45. ----------------        ---------------------       -----------
  46.     12B0                     F5 3E 5E               C3 <PATCH>
  47.  
  48. AND:
  49.  
  50.   <PATCH, LOC                  N/A                  FE 08 CA 3A
  51.     YOUR CHOICE>                                    XX F5 3E 5E
  52.                                                     C3 XX 33
  53.  
  54. NOTE: The 'XX's above must be replaced by the approprite page
  55. boundaries if your operating CP/M system.
  56.  
  57. Also since we are only echoing one backspace, the control
  58. characters which CP/M echoed as two characters will not be
  59. completely removed (We leave the '^').  Again I will leave it
  60. to you to come up with a more glamorous fix.
  61.  
  62. <EOF>
  63.