Download User Manual - v8.8 C166/ST10 C Compiler

Transcript
Chapter 3
3−84
#pragma regdef 6
/* MINIMIZE REGISTER USAGE to R0−R5 */
int stackparm ext_func( int );
R12−R15 */
interrupt (0x30) void
f()
{
int i;
/* stack parameter passing: NOT
/* allocate on user stack: NOT R6−R9 */
i = ext_func( 3 );
LANGUAGE
}
INTRPT_1_PR SECTION CODE WORD PUBLIC ’CPROGRAM’
_f
PROC TASK INTRPT_TASK INTNO INTRPT_INUM = 030h
; Stack: 2
MOV
DPP3:INTRPT_RB,R0
SCXT CP,#DPP3:INTRPT_RB
SCXT MDC,#00h
PUSH DPP0
PUSH DPP2
MOV
DPP2,#PAG C166_DGROUP
PUSH MDL
PUSH MDH
SUB
R0,#02h
MOV
R4,#03h
MOV
[−R0],R4
CALLS SEG _ext_func,_ext_func
ADD
R0,#02h
MOV
[R0],R4
ADD
R0,#02h
POP
MDH
POP
MDL
POP
DPP2
POP
DPP0
POP
MDC
POP
CP
BCLR IEN
RETI
_f
ENDP
INTRPT_1_PR ENDS
INTRPT_RB
REGDEF
R0−R5
Instead of using #pragma regdef 6 you can also use the command line
option −r6. When you use the −r command line option, you can also
specify the register bank name to be used and whether this register bank
should be COMMON or not.
Specifying −r6,MYBANK,c results into:
MYBANK
REGDEF R0−R5 COMMON = MYBANK_RB