6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 7:05 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Sep 16, 2017 12:25 pm 
Offline

Joined: Sat Sep 16, 2017 12:19 pm
Posts: 64
I know that many CPUs from that time use PLAs, in fact, my own CPUs use PLAs aswell! But there's something I don't understand: the arguments. For example, I have an ADD instruction with the following syntax (in bits):
FFFF AAA DDD BBB XXXX
(Here: F = function/opcode, the next are arguments: A = A source, B = B source, D = destination, X = not used)
But every time I look for the 6502 IS, I only find function matrix, no arguments. I want to know if the 6502 had arguments and if it did, how does it deal with them? I'm a newbie with the 6502 and I'm making a CPU inspired by the 4004, Z80 and 6502.


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 16, 2017 1:10 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
One or other of these links should help you:
http://www.masswerk.at/6502/6502_instruction_set.html
http://www.6502.org/tutorials/6502opcodes.html
http://www.obelisk.me.uk/6502/reference.html
https://www.dwheeler.com/6502/oneelkruns/asm1step.html

You will see that every instruction has a length: some are a single byte, some take one or two bytes of argument.

But because the 6502 is an accumulator machine, you won't find
ADD source1, source2, destination
because the destination for arithmetic is always the accumulator. And because it's an accumulator, it's also one of the sources. You will see
ADC operand
which will compute A <= A+operand, where operand may be interpreted as data, or an address, or the base for an indexed address, and so on.

Hope this helps.


Last edited by BigEd on Sun May 06, 2018 9:48 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 16, 2017 1:29 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
(Oh, and welcome!)


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 16, 2017 7:26 pm 
Offline

Joined: Sat Sep 16, 2017 12:19 pm
Posts: 64
Thanks, my dude :D


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

All times are UTC


Who is online

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