📄 macro_regioninit.s
字号:
;********************************************************************************
;* *
;* Copyright (C) 2002 Oki Electric Industry Co., LTD. *
;* *
;* System Name : uPLAT *
;* Module Name : uPLAT initialize region routine *
;* File Name : regioninit.s *
;* Revision : 01.00 *
;* Date : 2002/12/02 initial version *
;* *
;********************************************************************************
;
; This file contains the macro to
; copy RO code and RW data from ROM to RAM and zero-initialize
; the ZI data areas in RAM.
; This macro:
; a) copies RO code and/or RW data from ROM at Load$$area$$Base
; to RAM at Image$$area$$Base, of length Image$$area$$Length bytes.
; b) fills with zero the ZI data in RAM at Image$$area$$ZI$$Base,
; of length Image$$area$$ZI$$Length bytes.
MACRO
macro_RegionInit $areaname
IMPORT copy
IMPORT zi_init
LCLS namecp
LCLS copyloadsym
LCLS copybasesym
LCLS copylensym
LCLS zibasesym
LCLS zilensym
namecp SETS "$areaname"
copyloadsym SETS "|Load$$$$":CC:namecp:CC:"$$$$Base|"
copybasesym SETS "|Image$$$$":CC:namecp:CC:"$$$$Base|"
copylensym SETS "|Image$$$$":CC:namecp:CC:"$$$$Length|"
zibasesym SETS "|Image$$$$":CC:namecp:CC:"$$$$ZI$$$$Base|"
zilensym SETS "|Image$$$$":CC:namecp:CC:"$$$$ZI$$$$Length|"
; The following symbols are generated by the linker. They are imported
; WEAKly because they may not all have defined values. Those which are
; undefined will take the value zero.
IMPORT $copyloadsym, WEAK
IMPORT $copybasesym, WEAK
IMPORT $copylensym, WEAK
IMPORT $zibasesym, WEAK
IMPORT $zilensym, WEAK
LDR r0, =$copyloadsym ; load address of region
LDR r1, =$copybasesym ; execution address of region
MOV r2, r1 ; copy execution address into r2
LDR r4, =$copylensym
ADD r2, r2, r4 ; add region length to execution address to...
; ...calculate address of word beyond end...
; ... of execution region
BL copy
LDR r2, =$zilensym ; get length of ZI region
LDR r0, =$zibasesym ; load base address of ZI region
MOV r1, r0 ; copy base address of ZI region into r1
ADD r1, r1, r2 ; add region length to base address to...
; ...calculate address of word beyond end...
; ... of ZI region
BL zi_init
MEND
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -