We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Accumulator: Difference between revisions

From SnesLab
Jump to: navigation, search
(→‎See Also: ADC/SBC)
(flowed Instructions into body)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
An '''Accumulator''' is a very fast register inside a processor that acts as a mathematical scratch pad.
An '''Accumulator''' is a very fast register inside a processor that acts as a mathematical scratch pad.


The [[65c816]]'s accumulator can be either 8 or 16 bits in size, as configured by the M flag.  Labiak calls this 16-bit memory mode.
The [[65c816]]'s accumulator can be either 8 or 16 bits in size, as configured by the [[m flag]][[Labiak]] calls this 16-bit memory mode.  When the [[direct page]] is coincident with the [[zero page]], [[TDC]] is a good way to zero it.


The high byte ("B") is still retained even when the accumulator is 8 bits wide and can be accessed with [[XBA]].
The high byte ("B") is still retained even when the accumulator is 8 bits wide and can be accessed with [[XBA]].
It can be stored to and from an effective address with [[LDA]] and [[STA]].
Unlike both index registers, arbitrary integers can be added to/from the accumulator with [[ADC]] and [[SBC]].
It can be freely transferred to/from both the [[X index register]] (see [[TAX]] and [[TXA]]) and the [[Y index register]] (see [[TAY]] and [[TYA]]) and also the stack (see [[PHA]] and [[PLA]]).
It is not specified to have any particular value after reset.


The [[S-SMP]]'s accumulator is always 8 bits wide.
The [[S-SMP]]'s accumulator is always 8 bits wide.


=== See Also ===
=== See Also ===
* [[ADC]]
* [[SBC]]
* [[LDA]]
* [[STA]]
* [[PHA]]
* [[PLA]]
* [[TAX]]
* [[TAY]]
* [[TXA]]
* [[TYA]]
* [[Accumulator Addressing]]
* [[Accumulator Addressing]]


=== References ===
=== References ===
* [[Eyes & Lichty]] page 27, https://archive.org/details/0893037893ProgrammingThe65816/page/27
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/27 page 27]
* subparagraph 8.1.1 A Register on [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book II] of the official Super Nintendo development manual
* subparagraph 8.1.1 A Register on [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book II] of the official Super Nintendo development manual



Latest revision as of 16:56, 11 August 2024

An Accumulator is a very fast register inside a processor that acts as a mathematical scratch pad.

The 65c816's accumulator can be either 8 or 16 bits in size, as configured by the m flag. Labiak calls this 16-bit memory mode. When the direct page is coincident with the zero page, TDC is a good way to zero it.

The high byte ("B") is still retained even when the accumulator is 8 bits wide and can be accessed with XBA.

It can be stored to and from an effective address with LDA and STA.

Unlike both index registers, arbitrary integers can be added to/from the accumulator with ADC and SBC.

It can be freely transferred to/from both the X index register (see TAX and TXA) and the Y index register (see TAY and TYA) and also the stack (see PHA and PLA).

It is not specified to have any particular value after reset.

The S-SMP's accumulator is always 8 bits wide.

See Also

References