It is currently Wed Dec 13, 2017 12:15 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sat May 06, 2017 6:34 am 
Offline

Joined: Sat Nov 12, 2016 6:03 am
Posts: 7
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!


Top
 Profile  
 
PostPosted: Sat May 06, 2017 7:31 am 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 124
Location: Rio de Janeiro - Brazil
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.

_________________
http://nesrocks.com/blog/superpitfall30th/


Top
 Profile  
 
PostPosted: Sat May 06, 2017 10:20 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1866
Location: DIGDUG
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.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sun May 14, 2017 6:18 am 
Offline

Joined: Sat Nov 12, 2016 6:03 am
Posts: 7
Thx for the help.


Top
 Profile  
 
PostPosted: Sun May 14, 2017 6:21 am 
Offline

Joined: Sat Nov 12, 2016 6:03 am
Posts: 7
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.


Top
 Profile  
 
PostPosted: Sun May 14, 2017 6:27 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
RomarioSilva wrote:
int numbers of 8 bits, are represent as: 0 - 255 or (-128(negative) to 127(positive))

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).

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.


Top
 Profile  
 
PostPosted: Sun May 14, 2017 9:13 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 262
Negative Flag = bit 7

$80 N = 1
$7F N = 0

There is no "logic" behind it.


Top
 Profile  
 
PostPosted: Mon May 15, 2017 4:10 am 
Offline

Joined: Sat Nov 12, 2016 6:03 am
Posts: 7
Thx guys. :D


Top
 Profile  
 
PostPosted: Mon May 22, 2017 3:37 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 362
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).

_________________
http://www.mojontwins.com


Top
 Profile  
 
PostPosted: Wed May 24, 2017 4:13 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 262
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group