ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
71
M8C Instruction Set
4.34
Swap
SWAP
Each argument is updated with the other argument’s value. The Zero Flag is set if the Accumulator is
updated with zero, else the Zero Flag is cleared. The
swap X, [expr]
instruction does not affect
either the Carry or Zero Flags.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
SWAP
A, X
0x4B
5
1
SWAP
A, [expr]
0x4C
7
2
SWAP
X, [expr]
0x4D
7
2
SWAP
A, SP
0x4E
5
1
Conditional
Flags:
CF
ZF
Unaffected.
Set if Accumulator is cleared.
Example:
mov
A, 0x30
swap A, SP
;SP=0x30, A equals previous SP value
t
X
X
A
A
t
t
ram k
ram k
A
A
t
t
ram k
ram k
X
X
t
t
SP
SP
A
A
t
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...