RAM Overlay
6-10
6.4.2
RAM Overlay
RAM is reserved for variables in the following way. The start address of the
variable is equal to the address of the previous variable, plus the size of that
variable. The size of VAR1 thus depends on the start address of the next
variable. In the example below, dac_buffer starts 2 bytes (one word) after
current_buffer. This means that current_buffer must be one word long. The
variable after dac_buffer, save_dac_r0, starts 2 bytes (one word) after
dac_buffer. Therefore, dac_buffer is one word long. Similarly, save_dac_stat
starts 10 bytes (5 words) after save_dac_regs, therefore, save_dac_regs is a
variable five words long.
dac_buffer
equ
current_ 2 * 1
;RESW
1
save_dac_r0
equ
dac_ 2 * 1
;RESW
1
save_dac_regs equ
save_ 2 * 1
;RESW
5
save_dac_stat equ
save_da 2 * 5
;RESW
1
The above method should be used to declare all customer variables. This is
illustrated in the next section.
6.4.3
Adding Customer Variables
New variables should either be added directly to MAIN_RAM.IRX or should be
included as a module RAM.IRX file. To add a variable new_var, size one word,
would require adding the variable itself and modifying the
RAMEND_CUSTOMER constant. The original MAIN_RAM.IRX file is shown
below.
;****************************************************************
; MAIN_RAM.IRX
;
; Start of memory for MAIN module is defined in
; include”..\ram\ram.irx”
;****************************************************************
; General purpose variables
ledpattern
equ
RAMSTART_CU 2 * 1
keypress
equ
ledp 2 * 1
tabadr
equ
le 2 * 1
; Time 1 interrupt variables
save_tim1_stat
equ
save_ti 2 * 1
save_tim2_a0
equ
save_tim 2 * 1
save_tim2_a0a
equ
save_t 2 * 1
; Time 2 interrupt variables
Содержание MSP50C6xx
Страница 1: ...MSP50C6xx Mixed Signal Processor User s Guide Mixed Signal Products SPSU014A Printed on Recycled Paper...
Страница 6: ...vi...
Страница 14: ...xiv...
Страница 24: ...1 10...
Страница 296: ...Instruction Set Summay 4 210 Assembly Language Instructions...
Страница 332: ...Implementation Details 5 36 R7 Return Addr Return Addr Param 2 Param 2 Param 1 Param 1 R5 Stack data Function call...
Страница 366: ...6 12...