SpinAsm OR and SpinAsm XOR: Difference between pages

From PedalPCB Wiki
(Difference between pages)
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 1: Line 1:
==OR==
==XOR==
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 6: Line 6:
!Instruction coding
!Instruction coding
|-
|-
|OR
|XOR
|<nowiki>ACC | MASK </nowiki>
|ACC ^ MASK
|MMMMMMMMMMMMMMMMMMMMMMMM000001111
|MMMMMMMMMMMMMMMMMMMMMMMM000010000
|}
|}


======Description======
======Description======
OR will perform a bit wise "or" of the current ACC and the 24­bit MASK specified within the instruction word. The instruction might be used to load a constant into ACC provided ACC contains $000000
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"
{| class="wikitable"
|+Parameters
|+Parameters
Line 27: Line 27:


======Syntax======
======Syntax======
OR M
XOR M


======Coding Example======
======Coding Example======
<syntaxhighlight line="1">
<syntaxhighlight line="1">
OMASK EQU  $0F0000                         ;  
XMASK EQU  $AAAAAA                         ;  
                                             ;  
                                             ;  
;-------------------------------------------
;-------------------------------------------
sof  0,0                                    ; Clear all bits within ACC  
sof  0,0                                    ; Clear all bits within ACC  
or $1                                      ; Set LSB
xor  $0                                    ; Set all ACC bits
or %10000000_00000000_00000000              ; Set MSB
xor  %01010101_01010101_01010101            ; Invert all even numbered bits
or OMASK                                    ; Set ACC[19..16]
xor XMASK                                  ; Invert all odd numbered bits
and %S=[15..8]                            ; Set ACC[15..8]
</syntaxhighlight>
</syntaxhighlight>

Revision as of 20:54, 6 January 2023

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