Difference between revisions of "AND"

From Intellivision Wiki
Jump to: navigation, search
 
Line 1: Line 1:
(Kyle, just a short note before you get here.... be sure to indicate AND, XOR are <B>bitwise</B> instructions.  Recall how C names its operators:  &amp; is "bitwise AND", and &amp;&amp; is "logical AND.")
+
[[Category:CP1610]]
 +
<table border>
 +
<tr><td>Instruction Name</td><td>And</td></tr>
 +
<tr><td>Mnemonic</td><td>AND</td></tr>
 +
<tr><td>CP1610 Clock Cycles</td><td>10</td></tr>
 +
<tr><td>Interruptible</td><td>Yes</td></tr>
 +
<tr><td>Opcode Range</td><td>$0380-$0387</td></tr>
 +
<tr><td>Input Flags</td><td>None</td></tr>
 +
<tr><td>Output Flags</td><td>[[Sign Flag]], [[Zero Flag]]</td></tr>
 +
</table><br/>
 +
The And (AND) instruction performs a bitwise AND of the value at the specified address with the value in the specified register, stores the final result in the register, and sets or clears the [[Sign Flag]] and [[Zero Flag]] according to the resulting value.<br/>
 +
 
 +
    Format - Decle #1    Format - Word #2
 +
    0000:0010:0100:0rrr  aaaa:aaaa:aaaa:aaaa<br/>
 +
    where:
 +
        rrr  indicates the destination register
 +
              such that:
 +
                  rrr == 000    indicates register R0
 +
                  rrr == 001    indicates register R1
 +
                  rrr == 010    indicates register R2
 +
                  rrr == 011    indicates register R3
 +
                  rrr == 100    indicates register R4
 +
                  rrr == 101    indicates register R5
 +
                  rrr == 110    indicates register R6
 +
                  rrr == 111    indicates register R7<br/>
 +
        aaaaaaaaaaaaaaaa    indicates the source address

Revision as of 19:36, 12 January 2005

Instruction NameAnd
MnemonicAND
CP1610 Clock Cycles10
InterruptibleYes
Opcode Range$0380-$0387
Input FlagsNone
Output FlagsSign Flag, Zero Flag

The And (AND) instruction performs a bitwise AND of the value at the specified address with the value in the specified register, stores the final result in the register, and sets or clears the Sign Flag and Zero Flag according to the resulting value.

   Format - Decle #1    Format - Word #2
   0000:0010:0100:0rrr  aaaa:aaaa:aaaa:aaaa
where: rrr indicates the destination register such that: rrr == 000 indicates register R0 rrr == 001 indicates register R1 rrr == 010 indicates register R2 rrr == 011 indicates register R3 rrr == 100 indicates register R4 rrr == 101 indicates register R5 rrr == 110 indicates register R6 rrr == 111 indicates register R7
aaaaaaaaaaaaaaaa indicates the source address