;References:
;swi - vector_handler_forward
;swi_OS_Module - vector_handler_trap

;R12, R14 are on the stack

.os_word_21
 LDRB    R12, [R1, #0]			;get the parameter
 TEQ     R12, #0			;Define pointer?
 BNE     vector_handler_forward		;NO

 #if JIT_WIMP_support == 1
   BL      check_task_ID		;is the task supported?
   BNE     vector_handler_forward	;NO, call directly
 #endif

 LDR     R12, emulate_RISCOS
 CMP     R12, #&350 << 8		;below RO3.50?
 BHS     vector_handler_forward		;NO, pass to RISCOS

 STMFD   R13!, {R0-R2}			;preserve R0-R2
 ADR     R12, _SPSR			;buffer for C/SPSR (pre_swi_veneer)
 BL      pre_SWI_veneer			;call SWI that follows
 SWI     XOS_Word
 BL      post_SWI_veneer

 MOV     R0, #19
 SWI     XOS_Byte			;PRM1-652 force a VSync
 BL      dontexit_SWI_veneer		;return to entry CPU mode
LDMFD   R13!, {R0-R2, R12, PC}^

 ._SPSR		DBD 4
