forked from shoaib30/Microprocessor-Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDAC_halfwaveRectifier_Hardware.asm
More file actions
42 lines (33 loc) · 991 Bytes
/
DAC_halfwaveRectifier_Hardware.asm
File metadata and controls
42 lines (33 loc) · 991 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
assume cd:code,ds:data
data segment
sine db 0,11,22,33,43,54,63,72,81,90,97,104,109,115,119
db 122,125,126,127,126,122,119,115,109,104,97,90,81
db 72,63,54,43,33,22,11,0
PA equ 20a0h
CR equ 20a3h
data ends
code segment
START: MOV ax,data
MOV ds,ax
MOV al,80h
MOV dx,CR
OUT dx,al
RPT: MOV dx,PA
LEA si,sine
MOV cx,36d
NXT: MOV al,[si]
OUT dx,al
INC si
LOOP NXT
MOV cx,36d ;for getting the flat part of the half wave
MOV al,0
NXT2: OUT dx,al
LOOP NXT2
MOV ah,06h ;waiting for i/o
MOV dl,0ffh ;checking input
INT 21h
JZ RPT
MOV ah,4ch
INT 21h
code ends
end START