increment, decrement, and addressing?

For discussing the 65xx hardware itself or electronics projects.
Post Reply
Gadersd
Posts: 12
Joined: 11 May 2013

increment, decrement, and addressing?

Post by Gadersd »

How does the 6502 increment and decrement the X and Y registers? I orginally thought that the registers were loaded into the alu A input register and the carry was set to one, but I am not so sure anymore after I heard that the 6502 had a increment/decrement circuit seperate of the alu. Is the alu used or is the special increment/decrement circuit used? If the alu is used, how does it only add carry and not the B input register too? Is the B input register loaded with zero? Also, how does the 6502 generate the 1 for the high byte of the address when using the stack pointer? How does it generate 0 when accessing zero page and FF when access the interupt vectors?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: increment, decrement, and addressing?

Post by BigEd »

Many questions!

There's a dedicated conditional 16-bit incrementer for the PC.

Otherwise, it's all done by the ALU.

We can probably answer all your questions with reference to Hanson's block diagram and visual6502.

For example: http://visual6502.org/JSSim/expert.html ... l&steps=20
You'll note that the datapath control signal dpc29_0ADH17 zeroes out the top 7 bits of the high address bus for stack accesses.

OK... we can answer the questions, but it might take a little digging!

Cheers
Ed
Post Reply