6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jun 03, 2024 11:47 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Oct 15, 2020 4:51 am 
Offline

Joined: Thu Feb 27, 2020 9:15 am
Posts: 18
I want to make a python script that would generate C code for a project i am working on because i dont want to fill all 6502 instructions by hand (not only instructions but also the opcodes, operand count, byte size, etc.) and i need a convenient instruction set table i can usse to feed the script that does not contain bloat like descriptions, etc.

Can somebody please post a link if you know of such a table?
So far all instruction set tables need additional formatting which i would like to avoid for the sake of sanity and not spending 2h typing or removing the same stuff. :?


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2020 6:07 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Here's the best I have to hand, attached. Each cell can be read as a fixed-format text field, first four characters are the mnemonic, next three are the addressing mode, last is the base cycle count (there are some cases which increment these). You can infer from the addressing mode how many program bytes are needed:

  • Blank or A: 1 byte (opcode only)
  • imm, rel, zp, zpx, zpy, izp, izx, izy: 2 bytes (opcode and short operand)
  • abs, abx, aby, ind, iax: 3 bytes (opcode and long operand)
  • zpr: 3 bytes (opcode and two short operands)

Take note of the odd order they are listed in, for the most logical grouping. Add the top and left headers in hex for the opcode of any given cell.

This is for a 65C02 with all the goodies. NMOS is a bit different.


Attachments:
65C02 opcodes.csv [2.77 KiB]
Downloaded 104 times
Screen Shot 2020-10-15 at 9.02.38 am.png
Screen Shot 2020-10-15 at 9.02.38 am.png [ 248.2 KiB | Viewed 846 times ]


Last edited by Chromatix on Thu Oct 15, 2020 12:38 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2020 7:02 am 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 278
That's a pretty nifty table! Maybe it could be added to the "Documents" section of the site?


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2020 12:31 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 693
Location: North Tejas
There are many opcode charts online.

I found this one the other day: https://www.masswerk.at/6502/6502_instruction_set.html

And this one for the Z80: https://clrhome.org/table/


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2020 12:42 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10821
Location: England
This is the table I use
http://nparker.llx.com/a2/opcodes.html

(But I don't think it answers the OP's question.)


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 16, 2020 10:40 am 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
Here's the opcode list for an as yet unreleased simulator I've been using:

https://war.rui.nz/tmp/65C02-opcodes.csv

It's just the instruction and the addressing mode, the logic for which are in the simulator.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 31 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: