LOADA	EQU	0xFF10
SP	EQU	R15
STACKA	EQU	0x1000
CNTIA	EQU	0xFF02

	ORG	LOADA
	START	MAIN_PRGA

MAIN_PRGA	LDW	SP, #STACKA
		LDW	R0, #1
		STW 	R0, @CNTIA
		LDW	R0, #IT_PRGA
		STW	R0, @4*34
		LDW	R0, #IT_PRGB
		STW	R0, @4*35
		ENI
		TRP	#34
loop		JMP	#loop-$-2

IT_PRGA		STW R0, -(SP)
		LDW R0, @CNTIA
		SHL R0,	R0
		STW R0, @CNTIA
		LDW R0, (SP)+
		ENI
		RTI

IT_PRGB		STW R0, -(SP)
		LDW R0, @CNTIA
		SRL R0,	R0
		STW R0, @CNTIA
		LDW R0, (SP)+
		ENI
		RTI
