.text
.global _OSTrap
.global _OSTrapErrno
OSTrap:
sts.l pr, @-r15
mova TrapTable, r0
shll2 r4
mov.l @(r0, r4), r0
tst r0, r0
bt Exit
mov r5, r4
mov r6, r5
jsr @r0
mov r7, r6
mov.l OSTrapErrno, r1
mov.l @r1, r1
Exit:
lds.l @r15+, pr
rte
nop
.balign 4
OSTrapErrno:
.long 0
TrapTable:
.long _SysCall0Implementation
.long _SysCall1Implementation
/* ..and so on */