Page 45 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 45

Unit 3: Assembly Language Programming of 8085


                                                                                                  Notes
               IN         8-bit port address  Input from Port (Read a data byte from a input
                                            device)
                                            (a) It is a 2-byte instruction.
                                            (b) Reads data from the input port specified in the
                                                second byte and loads into Accumulator.

               HLT                          Halt
                                            (a) It is 1-byte instruction.
                                            (b) Processor stops executing and enters wait state.
                                            (c) The address bus and data bus are placed in
                                                high impedance state. No register contents are
                                                effected.

               NOP                          No Operation
                                            (a) It is a 1-byte instruction.
                                            (b) No operation is performed.
                                            (c) Used to increase processing time or substitute
                                                in place of an instruction.


            The symbols R, R  and R  represent any of the 8085 registers as A, B, D, E, H and L.
                          d    S
            The two machine control operations: HLT and NOP are necessary to execute the program. NOP
            is generally used when an error occurs in a program and an instruction needs to be eliminated. It
            is more convenient to substitute NOP than to reassemble the whole program. When HLT opcode
            is used then address bus and data bus are placed in the high-impedance state or tri-state. No
            registers contents are affected by HLT.
            As Table 3.2 states that the OUT and IN opcodes are 2-byte instructions the second byte is not
            defined. The question arises: what is the second byte in the instructions IN and OUT? The answer
            is the second byte is the I/O port address. Each I/O port is identified by a unique number. The
            second byte: 8-bits, i.e. 256 (2 ) combination. Thus 256 input ports and 256 output ports N addresses
                                  8
            from OOH to FFH can be connected to the system.
            Key Points about Data Transfer (Copy) Operations:
             1. Registers are used to load data directly or to save data bytes.
             2. The destination register is modified whereas the source register is not affected.

             3. Data copy instructions do not affect any of the status flags. This is because it involves two
                different registers or one register and one data byte. As only the Accumulator register can
                change or alter the status flag, all other registers B, C, D, E, H and L does not affect the flag
                register. Flags are affected by the operations in the ALU; therefore operations that take
                place outside the ALU do not affect flags.
             4. The 8085 transfer’s data from an input port to the Accumulator (IN) and from the
                Accumulator to an output port (OUT).
             5. The OUT instruction cannot send data from any other register except the Accumulator.
             6. The IN instruction can only load data into Accumulator.


                          In 8085 processor, data transfer instructions do not affect any flag.








                                             LOVELY PROFESSIONAL UNIVERSITY                                    39
   40   41   42   43   44   45   46   47   48   49   50