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

XBA: Difference between revisions

From SnesLab
Jump to: navigation, search
(type 1 admode)
(3 cycle Instructions)
 
(8 intermediate revisions by the same user not shown)
Line 7: Line 7:
|'''Speed'''
|'''Speed'''
|+
|+
|implied (type 1)
|[[Implied]] (type 1)
|EB
|EB
|1 byte
|1 byte
Line 14: Line 14:


{| class="wikitable" style="float:right;clear:right;width:30%"
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="8"|Flags Clobbered
!colspan="8"|Flags Affected
|+
|+
|N
|[[Negative Flag|N]]
|V
|[[Overflow Flag|V]]
|M
|[[M Flag|M]]
|X
|[[X Flag|X]]
|D
|[[Decimal Flag|D]]
|I
|[[I Flag|I]]
|Z
|[[Zero Flag|Z]]
|C
|[[Carry Flag|C]]
|+
|+
|
|
Line 35: Line 35:
|}
|}


'''XBA''' is an instruction that exchanges the high byte (B) and low byte (typically called A) of the [[C accumulator]].  It works even in [[6502 emulation mode]].  In [[65816 native mode]], its mnemonic is still "XBA" even when the accumulator is 16-bits wide.
'''XBA''' is an instruction that exchanges the high byte (B) and low byte (typically called A) of the [[C accumulator]].  It works even in [[6502 emulation mode]].  In [[65816 native mode]], its standard mnemonic is still "XBA" even when the accumulator is 16-bits wide. An alternative mnemonic is "SWA."


=== See Also ===
=== See Also ===
Line 43: Line 43:


=== External Links ===
=== External Links ===
* [[Eyes & Lichty]] page on XBA: https://archive.org/details/0893037893ProgrammingThe65816/page/n550
* [[Eyes & Lichty]] page 524, on XBA: https://archive.org/details/0893037893ProgrammingThe65816/page/n550
* [[Labiak]] page on XBA: https://archive.org/details/Programming_the_65816/page/n214
* [[Labiak]] page 204 on XBA: https://archive.org/details/Programming_the_65816/page/n214
* snes9x implementation of XBA: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L3261
* snes9x implementation of XBA: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L3261
* undisbeliever on XBA: https://undisbeliever.net/snesdev/65816-opcodes.html#xba-exchange-the-b-and-a-accumulators
* undisbeliever on XBA: https://undisbeliever.net/snesdev/65816-opcodes.html#xba-exchange-the-b-and-a-accumulators
Line 50: Line 50:
[[Category:ASM]]
[[Category:ASM]]
[[Category:65c816 additions]]
[[Category:65c816 additions]]
[[Category:Exchange Instructions]]
[[Category:One-byte Instructions]]
[[Category:Implied Instructions]]
[[Category:Three-cycle Instructions]]

Latest revision as of 11:53, 14 December 2023

Basic Info
Addressing Mode Opcode Length Speed
Implied (type 1) EB 1 byte 3 cycles
Flags Affected
N V M X D I Z C
. . . . . .

XBA is an instruction that exchanges the high byte (B) and low byte (typically called A) of the C accumulator. It works even in 6502 emulation mode. In 65816 native mode, its standard mnemonic is still "XBA" even when the accumulator is 16-bits wide. An alternative mnemonic is "SWA."

See Also

External Links