home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast.iso
/
pcmag
/
vol12n22.zip
/
NUMPRN.ZIP
/
BASES.SCR
< prev
next >
Wrap
Text File
|
1993-11-29
|
2KB
|
63 lines
A100
JMP 120 ; JMP begin
;=======================================
; begin number printing subroutine
;=======================================
; dploop:
XOR DX,DX
DIV CX
PUSH DX
CMP AX,0
JE 10F ; JE undo
CALL 102 ; CALL dploop
; undo:
POP DX
; pdig:
ADD DL,30
CMP DL,39
JLE 11B ; JLE pch
ADD DL,7
; pch:
MOV AH,2
INT 21
RET
;=============================================
; end number-printing subroutines.
;=============================================
; Add code that will *use* the number printing
; routine after this point.
;=============================================
;
; the remaining code prints 65,535 in hex
; and in every base from 10 down to 2
MOV CX,10 ; set up base 16
CALL 134 ; CALL printOneBase
MOV CX,0A ; start with base 10
; loop:
CALL 134 ; CALL printOneBase
DEC CX ; reduce base by 1
CMP CX,1
JA 129 ; JA loop:
INT 20
; printOneBase:
MOV AX,CX ; put current base in AX
PUSH CX ; save current base
MOV CX,0A ; set for base 10
CALL 102 ; CALL dploop
MOV DL,09 ; put a TAB in DL
CALL 11B ; CALL pch
POP CX ; restore current base
MOV AX,FFFF
CALL 102 ; CALL dploop
MOV DL,0D ; put carriage return in DL
CALL 11B ; CALL pch
MOV DL,0A ; put line feed in DL
CALL 11B ; CALL pch
RET
RCX
54
N BASES.COM
W
Q