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

[MiNT] Corruption of high TPA



Hello.

I have compiled some programs with the latest MiNTLib, everything works well on my usual ARAnyM + EasyMiNT setup.

Bur I tried them on another more complicated MiNT setup, with several resident programs, accessories, etc. and the new programs crashes in the startup code !

I managed to reproduce the crash with the very simple assembler program attached to this message. It is a stand-alone program, it does not use the MiNTLib but it mimics its behaviour. Basically, it initializes the stack at the top of the TPA, and displays a message.

On my problematic MiNT setup, it crashes even before displaying the message! But if I subtract 36 bytes from my new stack, it works. So it looks like the 36 highest bytes of the TPA are getting corrupted by something.

Could you please confirm that this small program is correct without any subtract, so my MiNT setup is broken ?

--
Vincent Rivière
	move.l	4(sp),a0	| get basepage
	move.l	4(a0),d0	| get _base->p_hitpa
	and.l	#0xfffffffc,d0	| align on lower 4 bytes

|	sub.l	#0,d0		| Bus Error before Hello
|	sub.l	#28,d0		| Bus Error before Hello
|	sub.l	#32,d0		| Bus Error after Hello
|	sub.l	#36,d0		| No Bus Error
	
	move.l	d0,sp		| this is the new stack

	pea	msg
	move.w	#9,-(sp)	| Cconws()
	trap	#1
	addq.l	#6,sp
	
	clr.w	-(sp)		| Pterm0()
	trap	#1

msg:	.asciz	"Hello!\r\n"