-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHienthibin.asm
57 lines (53 loc) · 1010 Bytes
/
Hienthibin.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
.model small
.stack 100
.data
xuong db 10,13,'$'
count db 0
muoi db 10
.code
Main proc
mov ax,@data
mov ds,ax
xor bx,bx
mov cx,16
Lap:
mov ah,1
int 21h
sub al,30h
shl bx,1
add bl,al
add count,al
Loop Lap
lea dx,xuong
mov ah,9
int 21h
mov cx,16
Lap1:
mov dl,30h
shl bx,1
adc dl,0
mov ah,2
int 21h
loop Lap1
xor ax,ax
mov al,count
xor cx,cx
Lap2:
xor dx,dx
div muoi
add ah,30h
mov dl,ah
push dx
inc cx
xor ah,ah
cmp ax,0
jne lap2
hienthi:
pop dx
mov ah,2
int 21h
loop hienthi
mov ah,4ch
int 21h
main endp
end main