[net.sources.bugs] PC-DOS/MS-DOS `touch' command

gino@voder.UUCP (Gino Bloch) (10/30/84)

[untouchable line]

I posted the source to a `touch' command for MS-DOS 2.x; it ran fine on
my PC at work (where I used v 1.27 of the Microsoft Macro Assembler), but
I later discovered that a bug in the IBM Macro Assembler v1.00 causes
incorrect assembly.  The problem is in the sixth line below (the one with
`xor' in it):
> to_upper:
> 	cmp	al,'a'		; convert to UC
> 	jb	short uc_end	; this isn't lc
> 	cmp	al,'z'
> 	ja	short uc_end	; nor is this
> 	xor	al,'a' xor 'A'	; this one was
> uc_end:	ret
One work-around is to change the line to:
 	xor	al,'a'-'A'	; this one was
This bug is among those documented a few months ago in Dr Dobb's Journal, I
think (but I haven't checked).  Another work-around, of course, is to use the
Microsoft assembler.

As long as I'm here, I'd like to mention that the message:
> no_file	  db	'touch: file not found',0dh,0ah,'$'
in my code is probably misleading; it would be more accurate if it said:
  no_file	  db	'touch: no matching file name',0dh,0ah,'$'
or some such.
-- 
Gene E. Bloch (...!nsc!voder!gino)