Mail Archives: djgpp-workers/2002/10/17/14:55:24
> * use echo instead of becho in batch files (what's becho?);
A program I wrote, attached. Replacing it is probably a good idea ;-)
title escape sequence printer
cseg segment
assume cs:cseg,ds:cseg
org 100h
start: mov si,81h
mov cl,ds:[80h]
mov ch,0
cmp cx,0
je exit
cmp byte ptr es:[si],' ' ; skip leading space if there
jne found_nonwhite
inc si
dec cx
found_nonwhite:
lp1: mov dl,[si]
inc si
dec cx
or cx,cx
js exit
cmp dl,'\' ; quoted character?
jne nexact
mov dl,[si] ; get next exactly
inc si
dec cx
or cx,cx
js exit
jmp print
nexact: cmp dl,'^' ; control character?
jne print
mov dl,[si] ; get next control
inc si
dec cx
or cx,cx
js exit
and dl,1fh
print:
mov ah,0eh ; print it
mov bl,0fh
mov al,dl
int 10h
jmp lp1
exit: int 20h
cseg ends
end start
- Raw text -