- if (inst2 == 0x051f) /* add.l $sp, $r12 */
- {
- cache->framesize += offset;
- }
+ /* Optional stack allocation for args and local vars <= 4
+ byte. */
+ if (inst == 0x0170) /* ldi.l $r5, X */
+ {
+ offset = read_memory_integer (next_addr + 2, 4, byte_order);
+ inst2 = read_memory_unsigned_integer (next_addr + 6, 2, byte_order);
+
+ if (inst2 == 0x0517) /* add.l $sp, $r5 */
+ {
+ cache->framesize += offset;
+ }
+
+ return (next_addr + 8);
+ }
+ else if ((inst & 0xff00) == 0x91) /* dec $sp, X */
+ {
+ cache->framesize += (inst & 0x00ff);
+ next_addr += 2;