forked from shoaib30/Microprocessor-Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOUNTER.asm
More file actions
56 lines (49 loc) · 1.06 KB
/
COUNTER.asm
File metadata and controls
56 lines (49 loc) · 1.06 KB
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
;COUNTER.asm
;Shoaib Ahmed
;14.10.15
;counter in the center of the screen
assume cs:code,ds:data
data segment
data ends
code segment
START: MOV ah,0
MOV al,3 ;resolution of 80x25
INT 10h ;setting resolution (bios interrupt)
INT 10h
MOV cx,100d
MOV bl,00
NXT: MOV al,bl
MOV ah,02 ;moving cursor to a particular col
MOV dl,40d ;col number stored in dl
MOV dh,12d ;row number stored in dh
INT 10h
CALL DISP
CALL DELAY
INC bl
LOOP NXT
MOV ah,4ch
INT 21h
DISP PROC
AAM
ADD ax,3030h
MOV dl,ah
PUSH ax
MOV ah,2
INT 21h
POP ax
MOV dl,al
MOV ah,2
INT 21h
RET
DISP ENDP
DELAY PROC
MOV si,0ffh
l2: MOV di,0ffh
l1: DEC di
JNZ l1
DEC si
JNZ l2
RET
DELAY ENDP
code ends
end START