;References:
;swi - vector_handler_forward

;R12, R14 are on the stack

;vector_handler_66
;-----------------
;Returns the RO3.1 address for DA2

.vector_handler_66
 TEQ     R1, #2				;Screen memory
 BNE     vector_handler_forward		;NO, pass call onto OS
 LDR     R12, is_screen_remapped
 TEQ     R12, #0			;is screen memory remapped?
 BNE     vector_handler_forward		;NO, pass call onto OS

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

 LDR     R12, [R13, #4]			;get PC from stack
 #if compile_RO == 400
   BIC     R12, R12, #&FC000003		;clear PSR
 #endif
 CMP     R12, #jit_slotsize		;is it the OS asking?
 BHI     vector_handler_forward		;YES, pass on

 ADR     R12, _SPSR			;buffer for C/SPSR (pre_swi_veneer)
 BL      pre_SWI_veneer			;call SWI that follows
 SWI     XOS_DynamicArea		;PRM5a-53

 MOV     R3, #&2000000			;RO3.1 DA2 end
 LDR     R2, DA2_size			;DA2 size
 SUB     R3, R3, R2			;RO3.1 DA2 start
 MOV     R5, #480 * 1024		;max DA2 size on RO3.1
B       exit_SWI_veneer			;return to original caller

 ._SPSR		DBD 4
