-
Notifications
You must be signed in to change notification settings - Fork 0
/
UPDO.ASM
62 lines (62 loc) · 768 Bytes
/
UPDO.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
.data
msg1 db 10,13,"up counting done ",10,13,"$"
msg2 db 10,13,"down counting done",10,13,"$"
.code
mov ax,@data
mov ds,ax
mov cx,100
mov al,0
top:push cx
push ax
call disp
call delay
pop ax
inc al
pop cx
loop top
lea dx,msg1
mov ah,09h
int 21h
call delay
mov cx,100
mov al,99
down:push cx
push ax
call delay
call disp
pop ax
dec al
pop cx
loop down
lea dx,msg2
mov ah,09h
int 21h
mov ah,4ch
int 21h
delay proc
mov bx,0aaah
l1: dec dx
jnz l1
ret
delay endp
disp proc
aam
add ax,3030h
push ax
mov dl,ah
mov ah,02h
int 21h
pop ax
mov dl,al
mov ah,02h
int 21h
mov ah,03h
int 21h
mov dl,0
mov ah,02h
int 10h
ret
disp endp
end