Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (48 sloc) 572 Bytes
HW2D PROC
;C=1 - PRINT WITH ZERO
;AX-NUMBER
;ES:DI - BUFFER
MOV BYTE PTR CS:[HW2DF],0
JNC HW2D4
INC BYTE PTR CS:[HW2DF]
HW2D4:
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
MOV SI,10
XOR CX,CX
HW2D1:
XOR DX,DX
DIV SI
PUSH DX
INC CX
OR AX,AX
JNZ HW2D1
TEST BYTE PTR CS:[HW2DF],1
JZ HW2D2
MOV CH,4
SUB CH,CL
MOV CL,CH
XOR CH,CH
XOR AX,AX
JCXZ HW2D22
HW2D3:
PUSH AX
LOOP HW2D3
HW2D22:
MOV CL,4
HW2D2:
POP AX
ADD AL,30H
STOSB
LOOP HW2D2
POP SI
POP DX
POP CX
POP BX
POP AX
RET
HW2DF DB 0
ENDP