[comp.binaries.ibm.pc.d] Patch for sendcode

hughes@math.Berkeley.EDU (eric hughes) (02/26/89)

In using the recently posted sendcode program, I ran across a bug.  
DOS function 2, which is used for output, is a "partially cooked"
mode.  In particular, it expands tabs to spaces (ick).  DOS function 6
does not do anything to the output, but can't output character 255.
This is all fixed in the diff file below.

Eric Hughes
hughes@math.berkeley.edu   ucbvax!math!hughes

===================
      32      32  |;   This MASM version adds comments, jump labels, and a check for DOS
      33      33  |;   versions earlier than 2.0.
+             34  |;
+             35  |; February 25, 1989     Eric Hughes, Oakland, CA
+             36  |;   DOS function 2 modifies several characters, notably 09 = <tab>,
+             37  |;     which is expanded to spaces.
+             38  |;   DOS function 6 does not modify characters, but cannot output
+             39  |;     character 255.  A test is made and the appropriate output
+             40  |;     service is chosen.
      34      41  |;
      35      42  |; Motivation for using this program:
===================
      95     102  |    cmp CL, 0
      96     103  |    jne setCL       ; get lower nibble if CL == 4
+            104  |
+            105  |; Assert: Character to be output is in DL
+            106  |;   Output it by function 6 unless it is 255, then by function 2
+            107  |    cmp DL, 0FFh
+            108  |    mov AH, 06h
+            109  |    jne output
+            110  |
      97     111  |    mov AH, 02h
+            112  |output: int 21h ;INT 21h service 02h: Output Character to STDOUT
-     98          |    int 21h ;INT 21h service 02h: Output Character to STDOUT
      99     113  |            ; character byte is in DL, output to device if
     100     114  |            ; output has been redirected (Version 2.0+)
===================
--