Tuesday, August 13, 2013

SAP-2 Immediate Logic Instructions

          SAP-2 as well has immediate logic instructions. Here are the three logic immediates: ANI, ORI, and XRI.



ANI

       ANI means AND immediate. The execution of this instruction will AND the accumulator contents with the immediate byte that follows the op code.

Figure 2

       Example:


From Figure 2, the (a) accumulator content is ANDed with (b) the immediate value C7H and (c) the result is  86H which is stored in the accumulator.






ORI

       ORI means OR immediate. It tells the computer to OR the accumulator contents with the immediate byte that follows the op code.

       Example:


For instance, if the content of accumulator is given by Figure 2, the execution of ORI 8FH will OR (a) 96H with (b) the immediate byte 8FH to produce (c) new accumulator contents of 9FH.





XRI

       XRI is the mnemonic for XOR immediate. It will XOR the accumulator contents with the immediate byte that follows the op code.

       Example:


If the accumulator content is given by Figure 2, then executing XRI 1BH will XOR (a) 96H with the (b) immediate byte 1BH to produce (c) 8CH which will be stored in the accumulator.











Previous topic:

SAP-2 Logic Instructions





Reference:
Brown, J. A., & Malvino, A. P. (1992, 3rd edition). Digital Computer Electronics. Career Education, page 184.

No comments:

Post a Comment