-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAddbintobin.asm
62 lines (55 loc) · 862 Bytes
/
Addbintobin.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
61
62
.model small
.stack 50
.data
bien1 dw ?
thongbao1 db 10,13,'So thu nhat : $'
thongbao2 db 10,13,'So thu hai : $'
thongbao db 10,13,'Tong la : $'
main proc
mov ax,@data
mov ds,ax
mov bx,0
mov cx,16
mov ah,09h
lea dx,thongbao1
int 21h
Lap1:
mov ah,01h
int 21h
sub al,30h
shl bx,1
add bl,al
loop Lap1
mov bien1,bx
mov bx,0
mov cx,16
mov ah,09h
lea dx,thongbao2
int 21h
Lap2:
mov ah,01h
int 21h
sub al,30h
shl bx,1
add bl,al
loop Lap2
add bx,bien1
mov cx,16
mov ah,09h
lea dx,thongbao
int 21h
mov dx,30h
adc dx,0
mov ah,02h
int 21h
Lap3:
mov dl,30h
shl bx,1
adc dl,0
mov ah,02h
int 21h
loop Lap3
mov ah,4ch
int 21h
main endp
end main