Chapter 5 Detailed Applications
- 86 -
73
74
MOV.L #FROM_,A0
75
MOV.L #TO_,A1
76
MOV.L #(sizeof SECT_ & 0FFFFFFH), R3R1
77
XCHG.W R1,R3
78
_loop:
79
SMOVF.B
80
CMP.W #0,R1
81
JEQ _end
82
MOV.B [A0],[A1]
83
ADD.L #1,A1
84
ADD.L #1,A0
85
MOV.W #0FFFFH,R3
86
SUB.W #1,R1
87
JMP _loop
88
_end:
89
.ENDM
90
91
;=================================================================
92
; Interrupt section start
93
;-----------------------------------------------------------------
94
.SECTION MR_KERNEL,CODE,ALIGN
95
96
;-----------------------------------------------------------------
97
; after reset,this program will start
98
;-----------------------------------------------------------------
99
__SYS_INITIAL:
100
LDC #__Sys_Sp,ISP ; set initial ISP
101
102
MOV.B #2,0AH
103
MOV.B #00,PMOD ; Set Processor Mode Register
104
MOV.B #0,0AH
105
LDC #0010H,FLG
106
LDC #__SB__,SB
107
LDC #0000H,FLG
108
LDC #__Sys_Sp,FB
109
LDC #__SB__,SB
110
111
; +-----------------------------------------------------+
112
; | ISSUE SYSTEM CALL DATA INITIALIZE |
113
; +-----------------------------------------------------+
114
; For PD308
115
__INIT_ISSUE_SYSCALL
116
117
;=================================================================
118
; MR_RAM zero clear
119
;--------------------------------------------------------
120
N_BZERO MR_RAM_NE_top,MR_RAM_NE
121
N_BZERO MR_RAM_NO_top,MR_RAM_NO
122
BZERO MR_RAM_top,MR_RAM
123
124
;=================================================================
125
; NEAR area initialize.
126
;--------------------------------------------------------
127
; bss zero clear
128
;--------------------------------------------------------
129
N_BZERO bss_SE_top,bss_SE
130
N_BZERO bss_SO_top,bss_SO
131
132
N_BZERO bss_NE_top,bss_NE
133
N_BZERO bss_NO_top,bss_NO
134
135
;--------------------------------------------------------
136
; initialize data section
137
;--------------------------------------------------------
138
N_BCOPY data_SEI_top,data_SE_top,data_SE
139
N_BCOPY data_SOI_top,data_SO_top,data_SO
140
N_BCOPY data_NEI_top,data_NE_top,data_NE
141
N_BCOPY data_NOI_top,data_NO_top,data_NO
142
143
;=================================================================
144
; FAR area initialize.
145
;--------------------------------------------------------
146
; bss zero clear
147
;--------------------------------------------------------
148
BZERO bss_FE_top,bss_FE
149
BZERO bss_FO_top,bss_FO
150
151
;--------------------------------------------------------
152
; Copy edata_E(O) section from edata_EI(OI) section