2 Source Files
2.2.3
In-line Assemble
The xgcc C compiler supports in-line assembly, so the asm statement can be used. As a result, the word "asm" is reserved for
system use.
asm("<character string>");
Format:
Example 1: /* HALT mode */
asm("halt");
Example 2: /* Trap Table*/
asm(" .long
.long
.long
.space
.long
.long
Example 3: BOOT(){
asm("xld.a %sp,0x3f00");
}
For details on how to write an assembly source, refer to Section 2.3, "Grammar of Assembly Source".
2.2.4
Prototype Declarations
Declaring interrupt handler functions
Interrupt handler functions should be declared in the following format:
<type><function name> __attribute__ ((interrupt_handler));
Example: void foo(void) __attribute__ ((interrupt_handler));
int int_num;
void foo()
{
int_num = 5;
}
Assembler code
foo:
2-4
BOOT\n\
ADDR_ERR\n\
NMI\n\}
4\n\
EINT0\n\
EINT1");
:
ld.a -[%sp],%r2
ld %r2,5
xld [int_num],%r2
ld.a %r2,[%sp]+
reti
Seiko Epson Corporation
/* set SP */
S5U1C17001C Manual
(Rev. 1.0)
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?