[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] what's wrong with this code?
> but how? It can't be my bug, I don't use a7 (sp) in that loop - it's used
> just as another data register. Of course I don't use bsr/jsr, just normal
> clearing loop movem.l d0-d6/a1-a7,-(a0) ... And when I'm in user mode I can
> modify stack as I want, exceptions use another (MSP/ISP) stack, right?
Not really. I don't know if you use traps in the code (didn't pay
attention to the thread), but if you do it anywhere, and your user code
clobbers the stack pointer, and fails to restore it before you do a trap,
you'll get bus errors, because MiNT needs to copy trap arguments from the
user stack (where they are) to the supervisor stack (where they should
be). So the user sp has to point to the memory area the program owns.
--
Konrad M.Kokoszkiewicz
mail: draco@atari.org
http://draco.atari.org
** Ea natura multitudinis est,
** aut servit humiliter, aut superbe dominatur (Liv. XXIV,25)
*************************************************************
** Taka to juz natura pospolstwa, ze albo sluzy ono unizenie,
** albo bezczelnie sie panoszy.