Renesas TM V.3.20A Especificaciones Pagina 262

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 762
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 261
Renesas Technology, Tools FAQs
Last Updated: July 5, 2000
Document Number: 01051106_e
Q.
CC32R V.2.00 introduces [Memory Models]. What are the differences between the compiled results of each model?
A.
The generated assembler code will differ according to the operation, as described below.
Data Access (variable)
When accessing data (variable), the code will differ depending on the instruction set used: 24-bit address (LD24
instruction) or 32-bit address (such as combination of SETH instruction and LD/ST instruction).
1.
Function Call
The code will differ depending on the type of function call used: PC-relative jump (BL instruction) or register-direct
jump (JL instruction).
2.
Function Address Acquisition
The code will differ depending on whether the function address is obtained with 24 bits (LD24 instruction) or 32 bits
(combination of SETH instruction and OR3 instruction).
3.
Below is a list of codes created by each Memory Model according to the selected operation.
Data Access
(variable, constant)
Function Call Function Address Acquisition
Small Model
LD24 R0,#_data
LD R0,@R0
BL $func
LD24 R1,#$func
LD24 R0,#_pfunc
ST R1,@R0
Small Model
with
"-memlarge"
SETH R0,#SHIGH(_data)
LD R0,@(LOW(_data),R0)
BL $func
LD24 R1,#$func
SETH R0,#HIGH(_pfunc)
OR3 R0,R0,#LOW(_pfunc)
ST R1,@R0
Medium Model
SETH R0,#SHIGH(_data)
LD R0,@(LOW(_data),R0)
BL $func
SETH R1,#HIGH($func)
OR3 R1,R1,#LOW($func)
SETH R0,#HIGH(_pfunc)
OR3 R0,R0,#LOW(_pfunc)
ST R1,@R0
Large Model
SETH R1,#SHIGH(_data)
LD R0,@(LOW(_data),R0)
SETH R1,#HIGH($func)
OR3 R1,R1,#LOW($func)
JL R1
SETH R1,#HIGH($func)
OR3 R1,R1,#LOW($func)
SETH R0,#HIGH(_pfunc)
OR3 R0,R0,#LOW(_pfunc)
ST R1,@R0
The following shows the C source code of the sample program foo.c and the assembler objects when compiled by each Memory
Model.
- Sample C-Source Program -
( foo.c )
1 extern int data;
2 extern void func(int);
3 extern void (*pfunc)(int);
4
5 void foo()
6 {
7 func(data);
8 pfunc = func;
9 }
10
Vista de pagina 261
1 2 ... 257 258 259 260 261 262 263 264 265 266 267 ... 761 762

Comentarios a estos manuales

Sin comentarios