forked from shoaib30/Microprocessor-Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBCD_counter_hardware.asm
More file actions
44 lines (40 loc) · 868 Bytes
/
BCD_counter_hardware.asm
File metadata and controls
44 lines (40 loc) · 868 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
assume cs:code,ds:data
data segment
PA EQU 44a0h ;20a0h
PB EQU 44a1h ;20a1h
PC EQU 44a2h ;20a2h
CR EQU 44a3h ;20a3h
data ends
code segment
start: MOV ax,data
MOV ds,ax
MOV dx,cr ;initializing 8155
MOV al,82h
OUT dx,al
MOV cx,100d
MOV al,00h
MOV dx,PA
NXT: OUT dx,al
CALL DELAY
ADD al,1
DAA
LOOP NXT
MOV cx,99d
NXT1: SUB al,1
DAS
OUT dx,al
CALL DELAY
LOOP NXT1
MOV ah,4ch
INT 21h
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