-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest2.asm
More file actions
75 lines (60 loc) · 818 Bytes
/
test2.asm
File metadata and controls
75 lines (60 loc) · 818 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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.model small
.stack 100h
.data
arr db 100 dup
num dd 0
upp_b dw 0
low_b dw 0
.code
main proc
;include 'emu8086.inc'
mov ax,0ffffh
mov dx,0ffffh
mov upp_b,dx
mov low_b,ax
mov bx,010h
mov cx,4
mov si,offset arr
mov ax,low_b
mov cx,4
mov dx,0
low_byte:
div bx
add dx,30h
cmp dx,3ah
mov [si],dx
inc si
mov dx,0
loop low_byte
mov ax,upp_b
mov cx,4
mov dx,0
upp_byte:
div bx
add dx,30h
mov [si],dx
inc si
mov dx,0
loop upp_byte
mov ah,2
output:
dec si
mov dl,[si]
call hex
int 21h
cmp si,0
je exit
loop output
exit:
main endp
hex proc
cmp dl,3ah
jge hexadd
jmp ended:
hexadd:
add dl,7
jmp ended
ended:
ret
hex endp
end main