Stack size

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stack size

Jump to solution
487 Views
Brax02
Contributor III

I have a question regarding the stack in the MC9S08SG16

 

The total size RAM is 1024 bytes. It starts from the address 0x80 until 0x047F.

 

To initilized the stack pointer I used the follwing asm cmd

 

     LDHX #RamEnd+1 ;point one past RAM

    TXS ;SP<-(H:X-1)

 

In the file MC9S08SG16.inc RamEnd is defined like that :

 

RAMEnd:           equ   $0000027F

 

 

My question is why it's not $0000047F ?

Labels (1)
0 Kudos
1 Solution
378 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello:

No problem. Yes, it was likely an error with the included file . You may use the one I attached.

Regards :smileyhappy:

/Jorge Gonzalez

View solution in original post

0 Kudos
3 Replies
378 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Brax02:

Where did you get that include file? I assume it was included automatically by some of the CodeWarrior versions maybe?

I checked the file included with CodeWarrior v10.5 and it actually indicates the next:

RAMEnd:       equ  $0000047F

I attach here the file I am talking about so you can compare it with the one you have.

Hope this is useful!

/Jorge Gonzalez

378 Views
Brax02
Contributor III

Hello Jorge,

Thanks for your answer !

Yes the file is automatically included. I used the CodeWarriorIDE version 5.9.0

It's probably a mistake.

0 Kudos
379 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello:

No problem. Yes, it was likely an error with the included file . You may use the one I attached.

Regards :smileyhappy:

/Jorge Gonzalez

0 Kudos