CH 2 - Data Transfer Group
CH 2 - Data Transfer Group
Chapter 2
I/O is assigned to separate address space of memory I/O is assigned with same address of memory.
Separate control line is not required It require control signal like IO/M
Memory space is reduced due to insertion of I/O address. Full memory address space can be used.
Machine cycle :
• Machine cycle is defined as the time required to
complete any operation of accessing either
memory or I/O which is the subpart of an
instruction cycle.
• In 8085 one machine cycle can consist of three to
six T-states.
Instruction cycle :
• An instruction cycle is defined as the time
required to complete the execution of one
instruction.
• In 8085 one Instruction cycle can consist of one to
five Machine cycles.
Addressing Modes in 8085
• Addressing modes are the way of specifying data to be operated by an instruction.
• This data is an immediate data or an address.
• It also specifies whether the given operand is register or register pair.
• The instructions are classified according to type of addressing data.
The addressing modes are classified into five types.
1. Direct addressing
2. Register Addressing
3. Register Indirect Addressing
4. Immediate addressing
5. Implicit addressing
Direct Addressing mode
• The address of the operand is specified in the instruction.
• e.g. LDA 3000 H
• Load accumulator with contents of memory location 3000 H.
• All of the direct addressing mode instructions are 3 byte instructions.
• All of the register indirect addressing mode instructions are 1 byte instruction.
1-byte instruction
2-byte instruction
3-byte instruction
1-Byte Instruction
The opcode and the operand of an instruction are represented in one byte only.
Example-1: MOV B,A (Copy the contents of accumulator in register B.)
2-Byte Instruction
Two-byte instruction is the type of instruction in which the first 8 bits indicates the
opcode and the next 8 bits indicates the operand.
Example-1: MVI A,32H (Copy 32H to accumulator.)
3-Byte Instruction
Three-byte instruction is the type of instruction in which the first 8 bits indicates the
opcode and the next two bytes specify the 16-bit address/data.
The low-order address is represented in second byte and the high-order address is
represented in the third byte.
Example-1: LDA 2050H (Copy8 bit content of memory address 2050 H to accumulator.)
INSTRUCTION SETS
The instruction set of 8085 microprocessor is divided into 5 different groups as following:
2) Arithmetic group
3) Logic group
4) Branching group
1) MOV rd , rs
• This instruction will copy destination register with the content of source register. The content of source
register are not altered i.e. they remain unchanged. rd and rs can be of one of registers A, B, C, D, E, H, L.
• Let [A]=05H and [B]= 55H
• Instruction: MOV A, B
• After execution: [A]=55H and [B]= 55H
• Instruction length: 1- byte
• Addressing mode: Register Addressing Mode
• Flags affected : None
2) MOV r , M
• This instruction will load destination register with the content of memory location,
whose address is stored in H-L register pair.
• The content of memory location are not altered.
• r can be any one of register A, B, C, D, E.
• Let [HL]=C500H & [B]= 82H
Memory
• Instruction: MOV B, M C500H 35 H
• This instruction will load the register r with 8- bit immediate data specified in second
byte of instruction.
• After execution:
Memory
C500H 82 H
• Let [A] = 35 H
• Instruction: STAX D
• After execution:
Memory
• [2525] = 55 H
2525 55 H
• Instruction length: 1- byte
• Addressing mode: Register indirect mode
• Flags affected : None
10) LXI Rp, 16-bit data/address
• 16 bit data is copied into the designated register pair. The register pairs can be BC, DE, HL
or SP.
• SP (stack pointer) is not a valid register pair, but it can be used in LXI instruction.
• LXI H, 3500 H
• After execution:
• H = 35 H and L = 00 H
• Let Memory
2100H 31H
2101H 52H
• Instruction : LHLD 2100 H
5. Copy 8-bit data from B2B2H memory location to C3C3H memory location.