Hi,
I have problem about stack on my 5604b system.
I want to create a section of stack frame, the size of which is 0xA8 byte.
the code like this:
e_stwu r1, -0xA8 (r1)
but the result is r1=r1-0x58 , I don't know what happened.How can I reliaze this purpose?
Very grateful for your assistance
已解决! 转到解答。
You need to read up on the instruction you're trying to use.
Documented in "Variable-Length Encoding (VLE) Programming Environments Manual," as:
e_stwu rS,D8(rA)
There are only 8 SIGNED bits available in the VLE version for the offset, so you're limited to -0x80 to 0x7f (0x70 or 0x7c for alignment).
Initially I thoughy you could code it as:
e_stwu r1, -0x70 (r1)
e_stwu r1, -0x38 (r1)
BUT that would end up with the wrong value stored on the stack, breaking the stack linkage, so it needs something a little smarter than that involving another temporary register.
I'd suggest you write a small C function with more than 0x80 bytes of function-local variables/storage, compile it and then disassemble it to see how the compiler solved this problem. Then copy what it did into your assembly code.
Tom
You need to read up on the instruction you're trying to use.
Documented in "Variable-Length Encoding (VLE) Programming Environments Manual," as:
e_stwu rS,D8(rA)
There are only 8 SIGNED bits available in the VLE version for the offset, so you're limited to -0x80 to 0x7f (0x70 or 0x7c for alignment).
Initially I thoughy you could code it as:
e_stwu r1, -0x70 (r1)
e_stwu r1, -0x38 (r1)
BUT that would end up with the wrong value stored on the stack, breaking the stack linkage, so it needs something a little smarter than that involving another temporary register.
I'd suggest you write a small C function with more than 0x80 bytes of function-local variables/storage, compile it and then disassemble it to see how the compiler solved this problem. Then copy what it did into your assembly code.
Tom