[comp.sys.atari.st.tech] Help with timerA

tsakogia@uk.ac.man.cs (George Tsakogiannis) (05/01/91)

This message is sent on behalf of Pakis Haliapas (haliapap@p4.cs.man.ac.uk):

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Does anybody out there know why when I compile the following program
(with HiSoft's GenST assembler) and run it on my STE the system crashes?

-------------------------
start
	bra	real_start
	even

TimerA_int
	rte
	even
     
real_start
	clr.l	-(sp)
	move.w	#$20,-(sp)
	trap	#1
	addq.l	#6,sp
	move.l	d0,old_sp
		
	move.l	#TimerA_int,$134
	move.b	#128,$FFFA1F
 	or.b	#$07,$FFFA19
	or.b	#$20,$FFFA07
	or.b	#$20,$FFFA13
	
	move.l	old_sp,-(sp)
	move.w	#$20,-(sp)
	trap	#1
	addq.l	#6,sp

loop1
	move.w	#2,-(sp)
	move.w	#1,-(sp)
	trap	#13
        addq.l	#4,sp
	cmp.w	#-1,d0
	bne	loop1
	
	move.w	#2,-(sp)
	move.w	#2,-(sp)
	trap	#13
	addq.l	#4,sp
	
	clr.w	-(sp)
	trap	#1


cl_counter	dc.l	0
old_sp		dc.l	0
-------------------------

The following program does exactly the same thing too:

-------------------------
start
	bra	real_start
	even

TimerA_int
	rte
	even
     
real_start
	move.l	#TimerA_int,-(sp)
	move.w	#128,-(sp)
	move.w	#7,-(sp)
	move.w	#0,-(sp)
	move.w	#31,-(sp)
	trap	#14
	add.l	#12,sp

loop1
	move.w	#2,-(sp)
	move.w	#1,-(sp)
	trap	#13
        addq.l	#4,sp
	cmp.w	#-1,d0
	bne	loop1
	
	move.w	#2,-(sp)
	move.w	#2,-(sp)
	trap	#13
	addq.l	#4,sp
	
	clr.w	-(sp)
	trap	#1


cl_counter	dc.l	0
old_sp		dc.l	0
-------------------------

Send any answers/comments/suggestions to 
haliapap@p4.cs.man.ac.uk
or to this net

Thank you in anticipation,
Pakis Haliapas,
Manchester.