home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
batch
/
library
/
batutl2
/
pause21.asm
< prev
next >
Wrap
Assembly Source File
|
1988-04-20
|
2KB
|
83 lines
TITLE PAUSE2 11-4-84 [4-16-88]
;Toad Hall Disassembly, tweak
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
; push DS ;save DS
CLD ;insure fwd
JMP Start ;skip over our buffer
;I don't know WHY the author decided to move the PSP command line
;into an internal buffer. We could have processed/displayed the
;cmd line characters just as easily as this buffer, and saved all
;the hassle of moving the damned thing!
;I DID throw out all his resetting of segment registers (DS and ES)
;just to LODSB and STOSB a buffer right here in the code segment!
;Donno why he messed with all that hassle either!
buffer DB 100H DUP(0)
Start:
; MOV AX,OFFSET Pause2
; MOV ES,AX ;ES=our buffer
; Assume ES:Nothing
; MOV DI,8 ;back to buffer start
mov di,offset buffer ;copying into buffer
MOV SI,80H ;DOS PSP cmd line start
LODSB ;snarf length byte
MOV CL,AL ;save in cl
XOR CH,CH ;clear msb to use as counter
LODSB ;snarf first cmd line char (space)
Lup223: LODSB ;snarf first cmd line char
CMP AL,CR ;done?
JZ L022B ; yep
STOSB ; stuff in buffer
LOOP Lup223 ; and keep looping
L022B: STOSB ;stuff the terminating CR or 0
; MOV AX,OFFSET Pause2 ;point DS to our buffer
; MOV DS,AX
; Assume DS:Nothing
;
; MOV SI,8 ;bump a little into the buffer
mov si,offset buffer ;snarfing FROM buffer now
MOV AH,2 ;prepare for Display Output
;Display our Pause2 prompt
Lup236: LODSB ;snarf old cmd line char
or al,al ;terminating 0?
je L0241 ; yep, done
CMP AL,CR ;terminating CR?
JZ L0241 ; yep, done
MOV DL,AL ; need char in DL
INT 21H ;Display output
JMP SHORT Lup236 ; and keep going
L0241:
mov ax,0C01H ;Clear kbd, do Func 1
INT 21H ; (kbd input w/echo)
; pop DS ;restore original DS
; ASSUME DS:CodeSeg
mov dx,offset CrLf ;string offset
mov ah,9 ;display string
int 21H
mov ax,4C00H ;terminate, Errorlevel 0
int 21H
CrLf db CR,LF,'$'
Pause2 endp
CodeSeg ENDS
END Pause2