Disassembler on nes emulator
Moderator: Moderators
-
- Posts: 7
- Joined: Sat Nov 12, 2016 6:03 am
Disassembler on nes emulator
hey people, i'm have some problems with disassembly some opcodes.
someone have any sugestions or online dissasembler, because i cant use then correctly.
thx!
someone have any sugestions or online dissasembler, because i cant use then correctly.
thx!
Re: Disassembler on nes emulator
I have succesfully disassembled the whole ghostbusters rom into reassemblable code using disasm and asm6. There were minor edits and tweaks that had to be done.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Re: Disassembler on nes emulator
If the ROM is bigger than NROM, you probably need to split the ROM into smaller chunks, before disassembling with disasm.
I wrote a disassembler, but it's not as advanced as disasm, except that it breaks the ROM into smaller chunks for you. (requires Python 3). Also, requires a complete NES file, with correct header.
https://github.com/nesdoug/NES-DISASSEMBLER
That reminds me, I forgot about the pull request. Hmm.
I wrote a disassembler, but it's not as advanced as disasm, except that it breaks the ROM into smaller chunks for you. (requires Python 3). Also, requires a complete NES file, with correct header.
https://github.com/nesdoug/NES-DISASSEMBLER
That reminds me, I forgot about the pull request. Hmm.
nesdoug.com -- blog/tutorial on programming for the NES
-
- Posts: 7
- Joined: Sat Nov 12, 2016 6:03 am
Re: Disassembler on nes emulator
Thx for the help.
-
- Posts: 7
- Joined: Sat Nov 12, 2016 6:03 am
Re: Disassembler on nes emulator
I have one ask.
int numbers of 8 bits, are represent as: 0 - 255 or (-128(negative) to 127(positive)), because i'm have some problems to set negative flag.
int numbers of 8 bits, are represent as: 0 - 255 or (-128(negative) to 127(positive)), because i'm have some problems to set negative flag.
Re: Disassembler on nes emulator
To the 6502, values in memory and registers are simultaneously signed and unsigned - no matter what operation you do on them, the result is exactly the same, and the processor Flags will be set for both cases (e.g. ADC will update both C for unsigned Carry and V for signed Overflow).RomarioSilva wrote: int numbers of 8 bits, are represent as: 0 - 255 or (-128(negative) to 127(positive))
In a disassembler you should pretty much always display numbers as unsigned, preferably in hexadecimal. It's up to the person reading the disassembly to interpret things further.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: Disassembler on nes emulator
Negative Flag = bit 7
$80 N = 1
$7F N = 0
There is no "logic" behind it.
$80 N = 1
$7F N = 0
There is no "logic" behind it.
-
- Posts: 7
- Joined: Sat Nov 12, 2016 6:03 am
Re: Disassembler on nes emulator
Thx guys.
Re: Disassembler on nes emulator
Well, in fact there *is* logic behind it. 80-FF are negative numbers because of the used notation, two's complement. One of the main advantages about it is that you can consider a byte value unsigned or signed depending on the context; arithmetic operations will always make sense. If you substract 04 from 01, the result is FD ('cause past 0, you start over: 1->0->FF->FE->FD), which, in two's complement, is -3.
The N flag is just an aid to the programmer, and it is kind of copied from bit 7 of the value in the accumulator after certain instructions (as negative numbers, 80-FF, all have bit 7 set).
The N flag is just an aid to the programmer, and it is kind of copied from bit 7 of the value in the accumulator after certain instructions (as negative numbers, 80-FF, all have bit 7 set).
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: Disassembler on nes emulator
Sorry, by Logic I was refereeing to Logic Gates. I.E the N is just a mirror of the 7th bit, there are no AND/OR/NOR/NAND logic involved in determining its value. Although as you point out there is a gate to enable the copy as it only happens on some instructions.