11 March 2016 - Forum Rules
Started by jvplouvem, November 05, 2021, 12:13:22 PM
C0/83D7: 78 sei C0/83D8: D8 cld C0/83D9: 18 clc C0/83DA: FB xce C0/83DB: C230 rep #$30C0/83DD: A9FF1F lda #$1FFFC0/83E0: 1B tcs C0/83E1: A90018 lda #$1800C0/83E4: 5B tcd C0/83E5: F47E7E pea $7E7EC0/83E8: AB plb C0/83E9: AB plb C0/83EA: 225C8187 jsr $87815C ; ---> It jumps to block bellow
C7/815C: E220 sep #$20C7/815E: 8B phb C7/815F: A980 lda #$80C7/8161: 48 pha C7/8162: AB plb C7/8163: A98F lda #$8F
Quote from: Cyneprepou4uk on November 05, 2021, 01:23:38 PMIt's a 24-bit addressing mode, so C7/815C is the only possible location.In other cases you look for a bankswitch routine nearby. Also usually there are not so many possible locations in several banks if you look at their routine logic. And debugging helps as well.
Quote from: Vehek on November 05, 2021, 01:35:22 PMDue to mirroring, different banks can refer to the same address. The disassembler's default assumption for the bank number was just different.
QuoteFor HiROMs, the SlowROM code begins at bank $40, and the FastROM copy at $C0.
Quote from: Raeven0 on November 06, 2021, 05:08:16 PMAccording to DisPel's documentation on github, the author has elected to handle program banks incorrectly: Your game's code apparently runs in banks $80 - $BF, but DisPel is going to disassemble it as though it runs in $C0 - $FF. That means your game code will not precisely match the disassembled output, and you will have to keep memory mirroring in mind whenever you see a long address.(The precise program bank does matter: consider the difference in the behavior of phk : plb : lda $0000 when K is $80 vs. $C0. Oddly, the author must have been aware of this issue, since immediately before the quoted line he explains the need to run SNES code only in its original bank and not a mirror bank. But he also chose to disassemble opcode $22 as jsr instead of the correct jsl, so who knows what he was thinking.)
Quote from: jvplouvem on November 05, 2021, 12:13:22 PMI'm trying to decompile a rom using Dispel tool(https://github.com/pelrun/Dispel)I want to name the labels, but the source code doesn't make me be sure I'm naming at the correct address
Quote from: Anime_World on November 11, 2021, 09:05:04 PMTry to do this with Mesen-S.
Quote from: jvplouvem on November 12, 2021, 01:57:07 PMI tried both(bsnes and Mesen-S), but Mesen-S has a bug, it shows "pea" with "#", for example pea #$7E7E.For debugging, Mesen-S is really good, but when i want to decompile i prefer bsnes because the reason above.Thank you friend for your time
Quote from: Anime_World on November 12, 2021, 08:54:10 PMAccording to the documentation it is correct with the immediate value "#" before. So it's not a bug.http://6502.org/tutorials/65c816opcodes.html#6.8.1
Quote from: Raeven0 on November 13, 2021, 01:20:27 PMBruce Clark is a prolific and influential writer, but is not WDC. In Programming the 65816, WDC supposes that PEA has absolute addressing and uses the syntax PEA $1234. (The doc even states that the instruction does not use immediate addressing syntax even if the argument is intended as immediate data.) But assembler authors can support whatever syntax they want, and as Bruce notes, immediate addressing syntax is more consistent with what the instruction actually does.
Page created in 0.056 seconds with 19 queries.