a C standard library for fx Casio calculators
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
768 B

#ifndef __ASM_CASIO_TRAPA_H__
# define __ASM_CASIO_TRAPA_H__
** Normally the SH3/SH4 processor provide a "trapa" instruction which allow
** tipping between userland and kernel. But Casio's don't use this method
** (this is why we are always in "privilegied mode" and we can do whatever
** we whant) but use custom calling convention to access the syscall call.
** The convention whant that the user jump into the syscall trampoline code
** located at 0x80010070 for fx9860g and 0x80020070 for fxcg20/50.
# define casio_trapa(id) \
mov.l syscall_table, r2 ;\
mov.l syscall_id, r0 ;\
jmp @r2 ;\
nop ;\
.align 4 ;\
syscall_table: .long 0x80020070 ;\
syscall_id: .long id
#endif /*__ASM__CASIO_TRAPA_H__*/