Page 132 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 132

Introduction to Microprocessors


                  Notes          impression that the contents of the source are destroyed when, in fact, the contents are retained
                                 without any modification. The various types of data transfer (copy) are listed below together
                                 with examples of each type:

                                                 Types                                Examples
                                   1. Between Registers.                  1. Copy the contents of the register B
                                                                             into register D.

                                   2. Specific data byte to a register or a  2. Load register B with the data byte 32H.
                                      memory location.

                                   3. Between a memory location           3. From a memory location 2000H
                                      and a register.                        to register B.
                                   4. Between an I/O device and the       4. From an input keyboard to the
                                      accumulator.                           accumulator.

                                 The data transfer instructions move data between registers or between memory and registers.
                                 MOV: Move

                                 MVI: Move Immediate
                                 LDA: Load Accumulator Directly from Memory
                                 STA: Store Accumulator Directly in Memory
                                 LHLD: Load H & L Registers Directly from Memory

                                 SHLD: Store H & L Registers Directly in Memory
                                 An ‘X’ in the name of a data transfer instruction implies that it deals with a register pair (16-bits);

                                 LXI: Load Register Pair with Immediate data
                                 LDAX: Load Accumulator from Address in Register Pair
                                 STAX: Store Accumulator in Address in Register Pair
                                 XCHG: Exchange H & L with D & E

                                 XTHL: Exchange Top of Stack with H & L

                                                The microprocessor, also known as a CPU (central processing unit).


                                 9.2 Arithmetic Operations

                                 These instructions perform arithmetic operations such as addition, subtraction, increment, and
                                 decrement.

                                 Addition: Any 8-bit number, or the contents of a register or the contents of a memory location
                                 can be added to the contents of the accumulator and the sum is stored in the accumulator. No two
                                 other 8-bit registers can be added directly (e.g., the contents of register B cannot be added directly
                                 to the contents of the register C). The instruction DAD is an exception; it adds 16-bit data directly
                                 in register pairs.
                                 Subtraction: Any 8-bit number, or the contents of a register, or the contents of a memory location
                                 can be subtracted from the contents of the accumulator and the results stored in the accumulator.
                                 The subtraction is performed in 2’s compliment, and the results if negative, are expressed in 2’s
                                 complement. No two other registers can be subtracted directly.



        126                              LOVELY PROFESSIONAL UNIVERSITY
   127   128   129   130   131   132   133   134   135   136   137