home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
batutl
/
batutl2.arc
/
PAUSE2.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-04-20
|
2KB
|
64 lines
TITLE PAUSE2 11-4-84 [4-16-88]
;Toad Hall Disassembly, thorough hack
LF EQU 0AH
CR EQU 0DH
;
;INITIAL VALUES : CS:IP 0000:0100
; SS:SP 0000:FFFF
CodeSeg SEGMENT
ASSUME DS:CodeSeg,SS:CodeSeg,CS:CodeSeg,ES:CodeSeg
ORG 100H
Pause2 proc near
CLD ;insure fwd
;The original code had all sorts of mess with copying the PSP
;command line into an internal 100H-byte buffer, changing segment
;registers (DS and ES) to point to that internal buffer start,
;etc. Donno WHY he messed with all that when it's much MUCH easier
;to deal with the PSP command line right from the start!
; We KNOW the first byte is the length byte, the next byte (if any
;length) will be a space, and the rest of the length will be characters,
;terminating with a CR.
MOV SI,80H ;DOS PSP cmd line start
LODSB ;snarf length byte
or al,al ;anything there?
je Get_Key ; nope, just to right to kbd input
dec al ;adjust for trailing CR
MOV CL,AL ;save in cl
XOR CH,CH ;clear msb to use as counter
LODSB ;snarf first cmd line char (space)
; and throw it away
mov ah,2 ;prepare for Display Output
Lup223: LODSB ;snarf first cmd line char
CMP AL,CR ;done? (just in case our count is off)
je Get_Key ; done, go get kbd input
mov dl,al ;need it in DL
int 21H ;display it
LOOP Lup223 ; and keep looping
Get_Key:
mov ax,0C01H ;Clear kbd, do Func 1
INT 21H ; (kbd input w/echo)
;Just for giggles (and to maybe add some functionality to this thing..)
;we'll return the keyboard input character's ASCII value as the Errorlevel:
mov bx,ax ;save AL (kbd input) a sec
mov dx,offset CrLf ;string offset
mov ah,9 ;display string
int 21H
mov ax,bx ;restore char as Errorlevel
mov ah,4CH ;terminate
int 21H
CrLf db CR,LF,'$'
Pause2 endp
CodeSeg ENDS
END Pause2