You are on page 1of 2

INTRODUCTION TO 8085 INSTRUCTIONS 203

light. By ORing these two data


ances.
of the input port by loading the

turn on the air conditioner, the coffeepot, and the kitchen


bytes the microprocessor can turn on the necessary appli
Memory Machine Instructions To test
Address Code Opcode Operand this
HI-LO
06 MVI B,91H
XX00
91
01
02 OE MVI C,A8H
A8
03
78 MOV A,B
04
program, we must simulate the readings
data into registers for example, into B and C.
PROGRAM

Comments

;This instruction simulates read-


; ing input port 01H
;This instruction simulates read-
; ing input port OOH
;It is necessary to transfer data
; byte from B to A to OR with
; C. B and C cannot be ORed
; directly
05 B1
;Combine ORA C
the switch positions
; from registers B and C in the
• accumulator
OUT
06 PORT1
;TurnD3on appliances and lights
07 PORT1
08 76 HLT ;End of the program
PROGRAM OUTPUT
By logically ORing the data bytes in registers B and C
(B) (A) = 1 0 0 1 0 0 0 1 (9 1H)
( C) = 1 0 1 0 1 0 0 0
( A8 H)
(A)= 1 0 1 1 1 0 0 1
(B9H)
Flag Status: S = 1, Z = 0, CY = 0

Data byte B9H is placed in the accumulator that turns on


the air conditioner, radio, cof-
feepot, and bedroom and kitchen lights.

6.3.6 Review of Important Concepts


1. Logic operations are performed in relation to the
contents of the accumulator.
2. Logic operations simulate eight 2-input gates (or
inverters).
3. The Sign, Zero (and Parity) flags are modified to
reflect the status of the operation.
The Carry flag is reset. However, the NOT operation
does not affect any flags.
4. After a logic operation has been performed, the
answer is placed in the accumulator
replacing the original contents of the accumulator.

You might also like