[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] what's wrong with this code?



Hi,

I use this dirty trick:

		move.l	#set_ssp,$80.w			; install new trap

		...

; this is an exception after trap #0 -> we're in
; supervisor and we set S bit to get into supervisor
; after receiving from exception

set_ssp:	bset	#5,(a7)				; set S flag
		rte

		...

and in my program loop I use:

		andi.w	#%1101111111111111,sr		; S = 0 -> User mode
		move.l	a7,save_usp			; save User SP

		[here do some stuff with a7]

		movea.l	save_usp,a7			; restore user SP
		trap	#0				; switch to
							; supervisor

With TOS, Magic, FreeMiNT it works ok. But to the moment I switch MP in FreeMiNT
on. Could someone tell me, what I do wrong? And why it appears just with MP?

Thanks in advance.


-- 

---------------------------------------------------------------------------
MiKRO         Atari XE/XL/Mega STE/Falcon060         http://mikro.atari.org
---------------------------------------------------------------------------