home *** CD-ROM | disk | FTP | other *** search
- TITLE WAITN 11-12-83 [4-19-88]
- ;Toad Hall Disassembly, tweak
-
- 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
-
- WaitN proc near
- MOV SI,80H ;DOS PSP cmd line
- CLD ;insure fwd
- LODSB ;snarf cmd line length byte
- OR AL,AL ;anything there?
- JZ Exit ; nope, exit right now
-
- MOV CL,AL ;save length in CL
- MOV AL,1
- MOV BL,0AH ;multiply by 10's
- Lup10F: MUL BL ;*10
- DEC CL ;decrement
- JNZ Lup10F
- MOV BX,AX ;number base is now in BX
- CmdBufLup:
- LODSB
- CMP AL,CR ;end of cmd line?
- JZ Exit ; yep, go exit
- CMP AL,'1' ;legal digit?
- JB CmdBufLup ; nope, ignore, reloop
- PUSH AX ;save the digit
- MOV CL,0AH ;/10
- MOV AX,BX ;number base
- DIV CL ; /10
- MOV BX,AX ;restore in bx
- POP AX ;restore digit
- xor ah,ah ;clear msb
- SUB AL,30H ;de-asciify
- MUL BX ;* number base
- Lup131: CMP AX,1 ;not done yet
- JB CmdBufLup ;timed out, keep processing cmd line
- MOV CX,65FFH ;delay constant
- Delay_139:
- LOOP Delay_139 ;delay a while
- DEC AX ;decrement our counter
- JMP SHORT Lup131 ; and see if we're done
-
- Exit: INT 20H ;terminate
-
- Waitn endp
-
- CodeSeg ENDS
- END WaitN