6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 4:34 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Jul 21, 2005 5:20 pm 
Offline

Joined: Wed Jul 20, 2005 11:08 pm
Posts: 53
Location: Hawaii
Can anyone give me a list of what the undocumented instructions of the MOS 6502 do? Undocumented as in undocumented (not listed on the NMOS 6502 Opcodes page).

_________________
Sam

---
"OK, let's see, A0 on the 6502 goes to the ROM. Now where was that reset vector?"


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 21, 2005 5:26 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
asmlang_6 wrote:
Can anyone give me a list of what the undocumented instructions of the MOS 6502 do? Undocumented as in undocumented (not listed on the NMOS 6502 Opcodes page).


Since the 6510 is just a 6502 with an I/O port integrated into it (literally, that's the only difference), you might want to find the 6510 undocumented opcode map. With the ubiquity of the Commodore 64, this almost certainly will be far easier to find than the 6502's list.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 21, 2005 5:41 pm 
Offline

Joined: Wed Jul 20, 2005 11:08 pm
Posts: 53
Location: Hawaii
kc5tja wrote:
Since the 6510 is just a 6502 with an I/O port integrated into it (literally, that's the only difference), you might want to find the 6510 undocumented opcode map.


Two things:

I didn't ask for the 6510 undocumented opcode map.

Where is that list, anyway?

_________________
Sam

---
"OK, let's see, A0 on the 6502 goes to the ROM. Now where was that reset vector?"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 21, 2005 10:43 pm 
Offline

Joined: Thu Jan 16, 2003 12:55 pm
Posts: 64
Location: Indianapolis
There's a list on my site, on the bottom of this section:
http://nesdev.parodius.com/#Docs6502

By all accounts I've heard, all CPUs based on the NMOS 6502 have the same undocumented ops. C64, Atari, and NES included.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 21, 2005 11:21 pm 
Offline

Joined: Wed Jul 20, 2005 11:08 pm
Posts: 53
Location: Hawaii
Memblers wrote:
There's a list on my site, on the bottom of this section:
http://nesdev.parodius.com/#Docs6502


I'm talking about undocumented as in not even on the "NMOS 6502 Opcodes" part of 6502.org.

_________________
Sam

---
"OK, let's see, A0 on the 6502 goes to the ROM. Now where was that reset vector?"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 21, 2005 11:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
kc5tja suggested the C64's 6510 because internally it's the same processor and searching the C64 material would likely get you what you're looking for. I understand that Berkeley Softworks used the undocumented op codes when they wrote GEOS for the C64.

Memblers also understood what you wanted, and gave the link to his site which in turn has plenty of good stuff for you. Three of the links I found there dealing with undocumented op codes are:
http://nesdev.parodius.com/undocumented_opcodes.txt
http://nesdev.parodius.com/extra_instructions.txt
http://nesdev.parodius.com/6502_cpu.txt

These unofficial op codes however really should only be used for legacy code and hardware. If you want a more powerful 6502, you'll do much better to use the CMOS version (expecially WDC's, which are being made today), or the 65816.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 22, 2005 12:51 am 
Offline

Joined: Wed Jul 20, 2005 11:08 pm
Posts: 53
Location: Hawaii
Thanks! I've found all the opcodes from $00 to $FF.

_________________
Sam

---
"OK, let's see, A0 on the 6502 goes to the ROM. Now where was that reset vector?"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Aug 07, 2005 5:44 am 
Offline

Joined: Wed Jul 20, 2005 11:08 pm
Posts: 53
Location: Hawaii
Correction: there is one opcode I can't find: $8B.

_________________
Sam

---
"OK, let's see, A0 on the 6502 goes to the ROM. Now where was that reset vector?"


Top
 Profile  
Reply with quote  
 Post subject: $8B = ANE
PostPosted: Wed Aug 10, 2005 12:42 pm 
Offline

Joined: Tue Nov 23, 2004 2:11 pm
Posts: 25
Location: London, UK
The operation $8B is documented in 6502_cpu.txt, under ANE (thanks Garth.) "The BBC Lives" has an updated version of the document, with a few corrections plus a section on the Commodore memory map (which I wouldn't know anything about, I'm just a BBC Micro guy.)


Top
 Profile  
Reply with quote  
 Post subject: Undocumented Opcodes
PostPosted: Fri Aug 12, 2005 8:56 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 280
Location: Northern California
GARTHWILSON wrote:
Three of the links I found there dealing with undocumented op codes are:
http://nesdev.parodius.com/undocumented_opcodes.txt
http://nesdev.parodius.com/extra_instructions.txt
http://nesdev.parodius.com/6502_cpu.txt

These unofficial op codes however really should only be used for legacy code and hardware. If you want a more powerful 6502, you'll do much better to use the CMOS version (expecially WDC's, which are being made today), or the 65816.

We should really take this information and put together a good document for 6502.org.

On a similar note, another thing that needs to be done is expanding the opcodes page for the additional 65C02 and 65C816 opcodes.

Any volunteers?

Thanks,
Mike

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 20, 2005 11:24 pm 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
By "expanding the opcodes page", do you mean something along the lines of the "NMOS 6502 Opcodes" (under the "Tutorials and Primers") for the 65C02 and 65816? If so, I'll volunteer for those. Rather than making one long document, I suggest three separate documents for the 6502, 65C02, and 65816. I would also suggest that the 65C02 document merely consist of the changes between the 65C02 and the 6502, since there are far more similarities (software-wise) than differences. The 65816, on the other hand, has very few opcodes with no changes and no additional functionality (CLC is one example). Even something like DEX which is 2 cycles and 1 byte under all conditions has a change in functionality: it's a 16-bit decrement when the x flag is 0, but an 8-bit decrement when x=1. Also, some examples that illustrate the "caveats" in the 65816 would probably be helpful, as these are somewhat lightly documented in the datasheet and WDC's Programming Manual.

I don't wish to discourage anyone from volunteering for the undocumented NMOS 6502 opcodes (I have a few 6502s, but have never really explored the undocumented opcodes myself), but I should point out that the various documents that describe these opcodes and the (cross) assemblers that can assemble them use names that differ from each other. For example, there are opcode names used in the March 1981 AAL article which do not appear in the documents linked above. It would be a good idea to do some research and gather as many different names as possible so that as many names as possible can be documented.


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Thu Nov 11, 2021 9:46 pm 
Offline

Joined: Tue Apr 19, 2005 7:25 pm
Posts: 15
GARTHWILSON wrote:
kc5tja suggested the C64's 6510 because internally it's the same processor and searching the C64 material would likely get you what you're looking for. I understand that Berkeley Softworks used the undocumented op codes when they wrote GEOS for the C64.

Memblers also understood what you wanted, and gave the link to his site which in turn has plenty of good stuff for you. Three of the links I found there dealing with undocumented op codes are:
http://nesdev.parodius.com/undocumented_opcodes.txt
http://nesdev.parodius.com/extra_instructions.txt
http://nesdev.parodius.com/6502_cpu.txt

These unofficial op codes however really should only be used for legacy code and hardware. If you want a more powerful 6502, you'll do much better to use the CMOS version (expecially WDC's, which are being made today), or the 65816.


Thanks for the information. After long research, I found the source of a bug on Ultima I on my Apple ][ emulator and sure enough, it was caused by an undocumented opcode. So, I decided to implement them on my underlying 6502 emulator.

However, looking at the links above, I see conflicting information with regards to status flags. For example, for opcodes $83, $87, $8F, $93

Document 1 claims that:

AAX (SAX) [AXS]
AND X register with accumulator and store result in memory. Status flags: N,Z

Document 2 claims that:

AXS *** (SAX)
AXS ANDs the contents of the A and X registers (without changing the contents of either register) and stores the result in memory.
AXS does not affect any flags in the processor status register.


Document 1 is not clear if the accumulator is affected and claims flags N and Z are. Document 2 however is more clear, claims accumulator is not affected and no flags are affected. I am thinking on using document 2 for my emulation, just wondering if there is anything updated and more streamlined by now ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Thu Nov 11, 2021 10:05 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
nelbr wrote:
[I'm] just wondering if there is anything updated and more streamlined by now.

See that section of my links page by going to http://wilsonminesco.com/links.html#soft and then down to the ten links after the blank line, starting with "How 6502 illegal op codes really work". Another blank line separates that section from the next one.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Thu Nov 11, 2021 10:43 pm 
Offline

Joined: Tue Apr 19, 2005 7:25 pm
Posts: 15
GARTHWILSON wrote:
nelbr wrote:
[I'm] just wondering if there is anything updated and more streamlined by now.

See that section of my links page by going to http://wilsonminesco.com/links.html#soft and then down to the ten links after the blank line, starting with "How 6502 illegal op codes really work". Another blank line separates that section from the next one.


Oh, great thanks. Very cool site and lots of information on those links.


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 15, 2021 11:08 am 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 293
"No More Secrets" https://csdb.dk/release/?id=198357is the best description I've seen. The most recent version includes the effect of the RDY pin on some instructions that had previously been considered to behave randomly.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 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: