Direct Page and Stack at C2 Bank, and Other Fundamental Info - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html) +--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html) +--- Thread: Direct Page and Stack at C2 Bank, and Other Fundamental Info (/thread-3161.html) Pages:
1
2
|
Direct Page and Stack at C2 Bank, and Other Fundamental Info - ReturnerScum - 03-06-2016 I've found some fundamental information about the Direct Page, which can be changed by assembly opcodes, and thought I'd make a page for critical reference info like this: Quote:Hatzen08 The user Synchisi also had a quote about the direct page changing in C2 based on code, so it's actually changed at times, apparently. The stack address can also be defined as well--It's not just $100 - $1FF like in previous chipsets. Does anyone know what the stack address boundaries are? RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - Synchysi - 03-06-2016 (03-06-2016, 01:24 AM)ReturnerScum Wrote: The user Synchisi also had a quote about the direct page changing in C2 based on code, so it's actually changed at times, apparently. For the record, this is done in the function that starts at C2/286D. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - Gi Nattak - 03-06-2016 (03-06-2016, 01:24 AM)ReturnerScum Wrote: The user Synchisi Good try lol. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - ReturnerScum - 03-06-2016 I should have put Graveyard Duck instead? I'm not sure what you're suggesting, but I don't like it! RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - Gi Nattak - 03-06-2016 I meant you misspelled his incredibly tricky name. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - madsiur - 03-06-2016 (03-06-2016, 04:06 PM)ReturnerScum Wrote: I should have put Graveyard Duck instead? It's not a duck but a guitar with a hoodie. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - ReturnerScum - 03-06-2016 I don't feel like we've offended enough people yet with this thread. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - HatZen08 - 03-06-2016 For the Final Fantasy 3 game, with a few exceptions, the developers didn't program with the direct page methodology. They set the direct page as zero and generally use it to clear the B register. (top byte of the A register in 8-bit mode). If you need a example of direct page, you can check the following code in the assembly: Code: C2/286E: F4 00 11 PEA $1100 (Set direct page register 11 $1100) For this example, PEA will put the address in the stack (two bytes) and PLD will remove it from the stack and set it as the direct page address. Note that the direct page is a special register and there are other opcodes which can copy or setup it as well. Common opcodes related with the setting/copy of the direct page are TCD, TDC, PHD and PLD. Opcodes related with the direct page has only one byte in the range [0, 255]. However, they are incremented with the direct page when they are executed. In this example, LDA $C9 is actually equivalent to LDA $11C9. The effective address is the direct page value ($1100) plus the operand ($C9), which is $11C9. I never found any opcode in the game related with the relocation of the stack pointer. However, specific opcodes exist for the stack relocation. They are TCS, TSC, TXS and TSX. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - Lockirby2 - 03-06-2016 (03-06-2016, 04:50 PM)Madsiur Wrote:(03-06-2016, 04:06 PM)ReturnerScum Wrote: I should have put Graveyard Duck instead? Thank you. Everybody at ID said I was crazy for seeing that. RE: Direct Page and Stack at C2 Bank, and Other Fundamental Info - Synchysi - 03-06-2016 That just means you're both crazy. |