-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPRINTNUM.INC
More file actions
32 lines (28 loc) · 785 Bytes
/
Copy pathPRINTNUM.INC
File metadata and controls
32 lines (28 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;-----------------------------------------------------------------------------
; macro to print any number providing the hexadecimal representation
;-----------------------------------------------------------------------------
;TO REMEBER TIME 35 ,1
PRINTNUM MACRO BINARY, DECIMAL,POSITION_X,POSITION_Y
LOCAL BACK
mov DECIMAL, '0'
mov DECIMAL + 1, '0'
MOV BX, 10
LEA SI, DECIMAL
ADD SI, 2
MOV AX, BINARY
BACK:
SUB DX, DX
DIV BX
OR DL, 30H
MOV [SI], DL
DEC SI
CMP AX, 0
JA BACK
MOV AH, 2
MOV DH, POSITION_Y ;Y POSITION FOR PRINTING
MOV DL, POSITION_X ;X POSITION FOR PRINTING
INT 10H
MOV AH, 9H ;PRINT THE NUMBER
LEA DX, DECIMAL
INT 21H
ENDM PRINTNUM