-
Notifications
You must be signed in to change notification settings - Fork 0
/
hexu.asm
60 lines (48 loc) · 905 Bytes
/
hexu.asm
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
public hexu
dseg segment para public 'data'
hex db '0','1','2','3'
db '4','5','6','7'
db '8','9','A','B'
db 'C','D','E','F'
dseg ends
cseg segment para public 'code'
assume cs:cseg, ds:dseg
hexu proc
push bp
mov bp, sp
mov bx, [bp+4]
mov cx, 4
mov dx, 4
mov si, 0
hexu_zero_skip:
rol bx, 1
rol bx, 1
rol bx, 1
rol bx, 1
mov si, bx
and si, 1111b
test si, si
jnz hexu_print
loop hexu_zero_skip
mov cx, 1
mov ah, 2
hexu_print:
mov dl, hex[si]
int 21h
rol bx, 1
rol bx, 1
rol bx, 1
rol bx, 1
mov si, bx
and si, 1111b
loop hexu_print
mov dl, 10
int 21h
mov dl, 13
int 21h
mov sp, bp
pop bp
ret 2
hexu endp
cseg ends
end