s5u1c17001c Epson Electronics America, Inc., s5u1c17001c Datasheet - Page 94

no-image

s5u1c17001c

Manufacturer Part Number
s5u1c17001c
Description
Cmos 16-bit Application Specific Controller
Manufacturer
Epson Electronics America, Inc.
Datasheet
4 SOURCE FILES
4.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.
Format:
Example 1:
Example 2:
Example 3:
For details on how to write an assembly source, refer to Section 4.3, "Grammar of Assembly Source".
4.2.4 Prototype Declarations
Declaring interrupt handler functions
4-4
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()
{
}
Assembler code
foo:
asm("<character string>");
/* HALT mode */
asm("halt");
/* Trap Table*/
asm(".long
BOOT(){
}
int_num = 5;
ld.a
ld
xld
ld.a
reti
.long
.long
.space
.long
.long
asm("xld.a
-[%sp],%r2
%r2,5
[int_num],%r2
%r2,[%sp]+
:
BOOT\n\
ADDR_ERR\n\
NMI\n\
4\n\
EINT0\n\
EINT1");
%sp,0x3f00"); /* set SP */
EPSON
(C COMPILER PACKAGE FOR S1C17 FAMILY) (Ver. 1.1)
S5U1C17001C MANUAL

Related parts for s5u1c17001c