Sunteți pe pagina 1din 9

Practical#6 Microprocessor 8085 instruction A microcomputer can conveniently be considered as device which reads binary coded information from

its input ports, manipulates this information according to a program stored within its memory and subsequently produces output information at its output ports:

Binary coded Information

Microcomputer STORED PROGRAM Binary coded Information

The instructions which make up the program are those selected by user from the instruction set of the microprocessor in order to perform the required task. Before a user is able to either write a program or interpret the meaning of a program, it is first necessary to become familiar with the different types of machine instructions which a typical microcomputer contains and to investigate their effect on the total system. Classification of Instruction Although a microprocessor may execute perhaps a hundred or more different machine instruction, each instruction can in general be classified as being a member of one of just five groups. These groups are: Data transfer Data manipulation Transfer of Control Input / Output Machine Control

Instruction in the data transfer group move data between the various processor register or between a processor register and a memory location. MOV A, B results in the contents of the B-register being transferred to the A-register. Instruction in the data manipulation group performs arithmetic and logical operations on data which is either in a specified processor register or a memory location. For example, ADD A, B Results in the A-register (accumulator) containing the sum of its previous contents and contents of B-register.AS will be seen; all instructions in this group normally modify processor flags. Each flag is one bit of the F-register and records some facts about the outcome of an operation, so that future actions may be decided accordingly. Instructions in the transfer of control group include unconditional and conditional (flag dependent) jump instructions and subroutine call and return instructions. All instructions in this group act on the program counter and indeed it is this group of instructions which gives the stored program machine its flexibility. For example, JMP 28F0 Results in the microprocessor breaking its normal mode of sequential instruction execution and instead jumping unconditionally to memory location 28F0 (hex) for the next instruction to be executed. JZ 28F0 would cause this to happen only if the last operation in the data manipulation produced result which was zero. Instruction in the input/output group move data between the various inputoutput ports of the system and an internal processor register-usually the Aregister. For example, OUT 05 Result in the contents of the A-register being transferred to output port 05 (hex). Instructions in the machine control group affect the state or mode of operation of the processor itself. Some examples to be discussed include interrupt enable and disable, processor halt (wait for an interrupt) and no operation instructions.

Addressing Modes The method by which the address of source of data or the address of destination of result is given in the instruction is called Addressing Modes. The term addressing mode refers to the way in which the operand of the instruction is specified. 1. Direct Addressing Mode 2. Register Addressing Mode 3. Register Indirect Addressing Mode 4. Immediate Addressing Mode 5. Implicit Addressing Mode or Operand Addressing Mode Direct Addressing Mode In this mode, the address of the operand is given in the instruction itself. LDA 2500 H Load the contents of memory location 2500 H in accumulator.

LDA is the operation. 2500 H is the address of source. Accumulator is the destination. Register Addressing Mode In this mode, the operand is in general purpose register. MOV A,B Move the contents of register B to A.

MOV is an operation B is the Source of data A is the destination Register Indirect Addressing Mode In this mode, the address of operand is specified by a register pair.

MOV A,M

Move data from memory location specified by H-L pair to accumulator.

MOV is the operation M is the memory location specified by H-L register pair. A is the destination. Immediate Addressing Mode In this mode, the operand is specified within the instruction itself. MVI Move 05 H in accumulator A, 05H MVI is the operation. 05 H is the immediate data (source). A is the destination. e.g. MVI A, FE (hex)

Source Data Destination Register Operation

this results in the data FE(hex) in this example being transferred to the A-register. A This is two byte instruction:
Operation Immediate Data

FE (hex)

Byte 1 byte2

3E FE

Similarly, a 16-bit register pair (BC, DE or HL) may be specified as the destination address and consequently these instructions require two bytes of immediate data. LXI H, 802D This result in the 16-bit register pair HL being loaded with immediate data 802D. (H)(L) This is a three byte instruction:
21 2D 80

802D (hex)

Another example LXI D, E627 Which means (H) (L) E627 (hex)
11 27 E6

Implicit Addressing Mode If address of source of data as well as address of destination of result is fixed, then there is no need to give any operand along with the instruction. CMA Complement accumulator CMA is the operation A is the source A is destination

XCHG Instruction There are limited number of data transfer instructions which involve combined 16bit register pair-for example, DE and HL.A typical instruction is: XCHG XCHG results in the contents of register pair DE being exchanged with the contents of register pair HL. This can be represented as: (DE) (HL)

Exercise

Q.1write down below assembly program into 8085 simulator softare. Assembly Instruction MNEMONIC MVI MOV MOV OP1 A B C OP2 FE A B (A) (B) (B) FE(hex) (A) (A) Comments

LXI

802D

(H)(L)

802D(hex)

LXI XCHG

E627

(D)(E) (D)(E)

E627 (H)(L)

Note: attach the snap shot of the program.

Snapshot:

Q.2 Execute above given program in 8085 simulator software. Snapshot:

Q.3 use additional selected from the data transfer group of instruction to perform the following task. (B) (A) (C) (D) (E) (H) (L) Snapshot: 87(HEX) (B) (B) 2F(HEX) (D) 3E(HEX) (H)

Q.4 please briefly describes the input and output port of MAT385 and IN and OUT instruction used in microprocessor 8085. Q.5 please describes the jump instructions of microprocessor 8085.

S-ar putea să vă placă și