SpinAsm XOR: Difference between revisions

From PedalPCB Wiki
Jump to navigation Jump to search
Created page with "==XOR== {| class="wikitable" |+ !Mnemonic !Operation !Instruction coding |- |XOR |ACC ^ MASK |MMMMMMMMMMMMMMMMMMMMMMMM000010000 |} ======Description====== XOR will perform a bit wise "xor" of the current ACC and the 24­bit MASK specified within the instruction word. The instruction will invert ACC provided MASK equals $FFFFFF. (see also the pseudo opcode section) {| class="wikitable" |+ !Name !Width !Entry formats, range |- |M |24 Bit |Binary Hex ($000000 - $FFFFFF) Sy..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
======Description======
======Description======
XOR will perform a bit wise "xor" of the current ACC and the 24­bit MASK specified within the instruction word. The instruction will invert ACC provided MASK equals $FFFFFF. (see also the pseudo opcode section)
XOR will perform a bit wise "xor" of the current ACC and the 24­bit MASK specified within the instruction word. The instruction will invert ACC provided MASK equals $FFFFFF. (see also the pseudo opcode section)
====== Parameters ======
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 30: Line 32:


======Coding Example======
======Coding Example======
<syntaxhighlight line="1">
<pre>
XMASK EQU  $AAAAAA                          ;  
XMASK EQU  $AAAAAA                          ;  
                                             ;  
                                             ;  
Line 38: Line 40:
xor  %01010101_01010101_01010101            ; Invert all even numbered bits  
xor  %01010101_01010101_01010101            ; Invert all even numbered bits  
xor  XMASK                                  ; Invert all odd numbered bits
xor  XMASK                                  ; Invert all odd numbered bits
</syntaxhighlight>
</pre>

Latest revision as of 13:46, 22 November 2024

XOR

Mnemonic Operation Instruction coding
XOR ACC ^ MASK MMMMMMMMMMMMMMMMMMMMMMMM000010000
Description

XOR will perform a bit wise "xor" of the current ACC and the 24­bit MASK specified within the instruction word. The instruction will invert ACC provided MASK equals $FFFFFF. (see also the pseudo opcode section)

Parameters
Name Width Entry formats, range
M 24 Bit Binary

Hex ($000000 - $FFFFFF) Symbolic

Syntax

XOR M

Coding Example
XMASK EQU  $AAAAAA                          ; 
                                            ; 
;-------------------------------------------
sof  0,0                                    ; Clear all bits within ACC 
xor  $0                                     ; Set all ACC bits
xor  %01010101_01010101_01010101            ; Invert all even numbered bits 
xor  XMASK                                  ; Invert all odd numbered bits