question about ALTSTACK

This is where the BIN Hackers and definition junkies discuss the inner workings of the EEC code and hardware. General tuning questions do not go here. Only technical/hardware-specific/code questions and discussions belong here.

Moderators: cgrey8, EDS50, Jon 94GT, 2Shaker

Post Reply
Gear Head
Posts: 1
Joined: Tue Jun 13, 2017 10:03 am

question about ALTSTACK

Post by Tancho67 » Tue Jun 13, 2017 10:20 am

I am having a problem interpreting this fragment from a PTP2 disassembly using SAD. it looks like the routine is placing a parameter (304d) on the regular stack and then returning to an address on the ALT stack. But I don't see where the address was placed on the ALT stack or any significance to the ALT stack location (a634). Is this just a bad decompile or my ignorance?

8 3042: a1,68,03,20 ldw R20,368 STACK = 368;
8 3046: ef,f1,f0 call 213a Sub250();
8 3049: a1,34,a6,22 ldw R22,a634 ALTSTACK = a634;
8 304d: f4 bnk0
8 304e: b1,11,11 ldb R11,11 BANK_SEL = 11;
8 3051: b1,ff,77 ldb R77,ff R77 = ff;
8 3054: c9,4d,30 push 304d push(304d);
8 3057: fe,f1 retia return;

BIN Hacker
Posts: 376
Joined: Mon Jun 23, 2008 1:39 pm

Re: question about ALTSTACK

Post by mpaton » Tue Jun 13, 2017 2:51 pm

When the Alt Stack is used, it is often (as here) used for the background dispatch tables/lists.

In the PTP2 bin, these start at 1A4D6 and continue through 1A70C. !A634 is in between these, and so when the Alt Ret instruction executes, it will go to the address at 1A634 which is 831DE


Re: question about ALTSTACK

Post by decipha » Sun Jun 25, 2017 5:44 pm

slight correction, not that it matters though

the background list ends at 1xa6f4

1xa70a is the xtalhps rate for a 24mhz clock with 1xa70c being the 24mhz clock index table

that 31de routine is where the setup for the 1st mafv read loop happens

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests