Differences

This shows you the differences between two versions of the page.

Link to this comparison view

instructions:and [2008/11/25 13:55] (current)
scott created
Line 1: Line 1:
 +====== Logical AND (AND)/OP=42 ======
  
 +==== Format ====
 +
 +^  OP  ^  AF  ^  BF  ^  A Syllable  ^  B Syllable  ^  C Syllable  ^
 +
 +''OP = 42''
 +
 +**AF** is the length of the //A Syllable// field.  **AF** may be indirect or may indicate the //A Syllable// is a literal.  A value of __00__ is equal to a length of 100 units.\\
 +**BF** is the length of the //B Syllable// field.  **BF** may be indirect.  A value of __00__ is equal to a length of 100 units.
 +
 +The //A Syllable// is the address of the **A** source field.   Address may be indexed, indirect or extended.  The final address controller data type must be **UN** or **UA** and must be the same as the other address controllers.\\
 +The //B Syllable// is the address of the **B** source field.   Address may be indexed, indirect or extended.  The final address controller data type must be **UN** or **UA** and must be the same as the other address controllers.\\
 +The //C Syllable// is the address of the result field.   Address may be indexed, indirect or extended.  The final address controller data type must be **UN** or **UA** and must be the same as the other address controllers.
 +
 +If the data types are not all **UA** or all **UN** cause an //Invalid Instruction (**IEX = 03**) fault//.  See 
 +[[compatibility_notes:a.11.1|Compatibility Notes A.11.1]].
 +
 +==== Function ====
 +
 +The Logical AND instruction stores the logical product (AND) of 
 +two data fields (**A** & **B**), located in memory, into a 
 +third memory location (**C**).
 +
 +The **C** field length is equal to the larger of **AF** or **BF**.  If the
 +**A** and **B** fields are not of equal length, pad the shorter by adding
 +trailing characters/digits of all zero bits.
 +
 +==== Comparison Flags ====
 +
 +Set the [[processor_state:comparison_flags|Comparison Flags]] to **HIGH**
 +if the least significant bit of the result is a __one__; otherwise, set
 +them to **EQUAL**.
 +
 +==== Overlap ====
 +
 +Total overlap or matching type-address overlap of any of the fields is
 +allowed.  Partial overlap of the **A** or **B** fields with **C** other
 +than matching type-address overlap may produce incompatible results. See
 +[[compatibility_notes:a.11.2|Compatibility Notes A.11.2]].
 +
 +==== Examples ====
 +
 +=== Example (1) AND Two Numeric Fields ===
 +
 +^  OP  ^  AF  ^  BF  ^  A Syllable  ^  B Syllable  ^  C Syllable  ^
 +|  42  |  02  |  03  |  A field (UN)  |  B field (UN)  |  C Field (UN)  |
 +
 +                      BEFORE         AFTER
 +    A FIELD             F6         unchanged 
 +    B FIELD            235         unchanged
 +    C FIELD            nnn            220
 +
 +    COMPARISON          nn           EQUAL
 +
 +=== Example (2) AND Two Alpha Fields ===
 +
 +^  OP  ^  AF  ^  BF  ^  A Syllable  ^  B Syllable  ^  C Syllable  ^
 +|  42  |  02  |  03  |  A field (UA)  |  B field (UA)  |  C field (UA)  |
 +
 +                      BEFORE         AFTER
 +    A FIELD            E7E8        unchanged
 +    B FIELD          D4D8D1        unchanged
 +    C FIELD          nnnnnn         C4C800
 +
 +    COMPARISON          nn            EQUAL
instructions/and.txt ยท Last modified: 2008/11/25 13:55 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki