EASy68K
http://www.easy68k.com/EASy68Kforum/

Error during Exception Handler: SSP odd or outside memor
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1261
Page 1 of 1

Author:  AsmMan [ Sat Nov 30, 2013 3:31 pm ]
Post subject:  Error during Exception Handler: SSP odd or outside memor

I'm starting with assembly 68k and Easy68k and I have a problem now.
What does means the error 'during Exception Handler: SSP odd or outside memory space'? It happen with the below code. Also, I was trying to translate some intel's assembly 8086 to Motorola 68k. The push/pop I did with usual moves but the sub to allocate space to local variables I did with SP itself once there's no bp Is this right?

Code:
START ORG $1000

   BSR DOMAIN
   MOVE #9,D0       
        TRAP #15 
DOMAIN:
   BSR DOFOO
   MOVE D0,-(SP)
   BSR PRINTN
   ADDQ.L #4,SP
   RTS
DOFOO:
        SUB #8,SP
   MOVE #10,D0
   MOVE D0,-4(SP)
   MOVE -4(SP),D0
   MOVE D0,-8(SP)
   MOVE #3,D0
   ADD -8(SP),D0
   MOVE D0,-8(SP)
   MOVE -8(SP),D0
        ADD #8,SP
   RTS
PRINTN:
        MOVE 4(SP),D1
        MOVE #3,D0
        TRAP #15
        RTS

   END START

Author:  profkelly [ Sat Nov 30, 2013 7:13 pm ]
Post subject:  Re: Error during Exception Handler: SSP odd or outside memor

The error message is telling you that an exception occurred and that during the processing of the exception the stack pointer was at an odd address or was outside the memory space.

In your example the instruction MOVE D0,(-SP), in the DOMAIN: subroutine, is pushing 2 bytes of D0 onto the stack. The following ADDQ.L #4,SP should be ADDQ.L #2,SP.

Author:  AsmMan [ Sat Nov 30, 2013 8:24 pm ]
Post subject:  Re: Error during Exception Handler: SSP odd or outside memor

profkelly wrote:
The error message is telling you that an exception occurred and that during the processing of the exception the stack pointer was at an odd address or was outside the memory space.

In your example the instruction MOVE D0,(-SP), in the DOMAIN: subroutine, is pushing 2 bytes of D0 onto the stack. The following ADDQ.L #4,SP should be ADDQ.L #2,SP.


Thanks very much. Also, is my offsets to access local variables right?

Author:  profkelly [ Sat Nov 30, 2013 11:37 pm ]
Post subject:  Re: Error during Exception Handler: SSP odd or outside memor

AsmMan wrote:
is my offsets to access local variables right?

I'll leave that for you to decide. Use the simulator to trace through the code (F7). The stack memory may be viewed by selecting "View/Stack" from the simulator menu.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/