CNTMA	EQU	0xFF00
LOADA	EQU	0xFF10
CNTIA	EQU	0xFF02

SP	EQU	R15
STACK	EQU	0x1000

	ORG	LOADA
	START	LOADA

main	LDW R0, #it_prga
	STW R0, @4*34
	LDW SP, #STACK
	LDW R0, #0
	STW R0, @CNTIA
	ENI
debut	LDW R1, #0	// R1 contient cntm
	STW R1, @CNTMA
	LDW R2, #0x006F
retest	CMP R1, R2
	BGE next-$-2
	STW R1, @CNTMA
	JSR @ajout
	BMP retest-$-2
next	BMP debut-$-2

ajout	LDW R1, @CNTMA
	ADQ 16, R1
	RTS

it_prga	STW SR, -(SP)
	STW R0, -(SP)
	LDW R0, @CNTIA
	ADQ 2, R0
	STW R0, @CNTIA
	LDW R0, (SP)+
	LDW SR, (SP)+
	RTI
