-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cau_2.asm
56 lines (43 loc) · 1.62 KB
/
Cau_2.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
;===================== Main and Interrupt Start ==================
ORG 00h ;Start from address 00h
LJMP MAIN ;Jump to Main program
ORG 03h ;External 0 interrupt start
NOP ;No code
RETI ;Return from interrupt
ORG 0Bh ;Timer 0 overflow interrupt start
NOP ;No code
RETI ;Return from interrupt
ORG 13h ;External 1 interrupt start
NOP ;No code
RETI ;Return from interrupt
ORG 1Bh ;Timer 1 overflow interrupt start
NOP ;No code
RETI ;Return from interrupt
ORG 23h ;Serial port interrupt start
NOP ;No code
RETI ;Return from interrupt
ORG 2Bh ;Timer 2 overflow interrupt start
NOP ;No code
RETI ;Return from interrupt
;====================Define Variable and Constant=================
;=================================================================
; MAIN PROGRAM
;=================================================================
ORG 50H ;Start Main program at 50H in ROM
Main:
MOV R0, #10 ;Set R0 to Array length
MOV DPTR, #1000H ;Set DPTR to External Array Address
MOV R1, #50H ;Set R2 to Internal Array Address
LCALL Data_transfer ;Start transfer data
here:
SJMP here ;
;=====================Define Function Program=====================
Data_transfer:
MOVX A, @DPTR ;Read from External Ram to Acc
MOV @R1, A ;Save from Acc to Internal Ram
INC DPTR ;Next External Ram Address
INC R1 ;Next Internal Ram Address
DJNZ R0, Data_transfer ;If R0>0, loop again
RET ;Return to Main
;====================Define Interrupt Handler=====================
END