🏁
T9
/
5️⃣
Sem 5
/
Practicals
Practicals
/
MI
MI
/
Lab 1

Lab 1

Lab 1 : PROGRAMMING BASED ON DATA TRANSFER AND ARITHMETIC OPERATIONS
OBJECTIVE
To familiar with the use of data transfer and arithmetic instruction set of 8085
PRELAB
Read data transfer  and arithmetic instructions from textbook in detail.
OVERVIEW OF DATA TRANSFER AND ARITHMETIC INSTRUCTIONS
Opcode
Operand
Description
MOV
Rd, Rs
Copies data from source register Rs to Rd
MVI
R, 8-bit
Copies 8-bit data to register R
LXI
Rp, 16-bit
Copies 16-bit data to register pair Rp
LXI
SP, 16-bit
Copies 16-bit data to stack pointer SP
MOV
R, M
Copies 8-bit data stored at memory location specified by the content of HL register to register R
LDAX
B/D
Copies 8-bit data stored at memory location specified by the content of BC or DE register to the accumulator
LDA
16-bit
Copies 8-bit data stored at memory location specified by 16-bit address to the accumulator
MOV
M, R
Copies data from a register R into the memory location specified by the HL pair
STAX
B/D
Stores the content of the accumulator to the memory location specified by the BC or DE pair
STA
16-bit
Stores the content of the accumulator to memory address
MVI
M, 8-bit
Stores 8-bit data to the memory location specified by the register pair HL
XCHG
Exchanges H and L with D and E respectively
ADD
R
Adds the content of register R to the content of the accumulator
ADI
8-bit
Adds the 8-bit data to the content of the accumulator
SUB
R
Subtracts the content of register R from the content of the accumulator
SUI
8-bit
Subtracts 8-bit data from the content of the accumulator
INR
R
Increases the content of register R by 1
DCR
R
Decreases the content of register R by 1
ADD
M
Adds the content of memory location specified by register pair HL to the content of the accumulator
SUB
M
Subtracts the content of memory location specified by register pair HL from the content of the accumulator
INR
M
Increments the content of the memory location specified by register pair HL by 1
DCR
M
Decrements the content of the memory location specified by register pair HL by 1
EXERCISES
1. Load the memory address 2100H with 0x45 and transfer it to accumulator. Copy accumulator to register B, C, D, E, H and L.
MVI A, 0x45
LXI H, 2100H
MOV M, A
MOV A, M
MOV B, A
MOV C, A
MOV D, A
MOV E, A
MOV H, A
MOV L, A
HLT
2. Load the accumulator with 0x45 and save accumulator at memory location 2105H.
MVI A, 0x45
LXI H, 2105H
MOV M, A
HLT
3. Write instructions to load 0x65 in register C and 0x92 in the accumulator. Store the content of both register at memory location 2122H and 2212H.
MVI C, 0x65
MVI A, 0x92
LXI H, 2122H
MOV M, C
LXI H, 2212H
MOV M, A
HLT
4. Write a program to exchange the content of B and C register.
MOV D, B
MOV B, C
MOV C, D
HLT
5. Write a program to exchange the content of memory location 2000H and 2001H.
LXI H, 2000H
MOV A, M
LXI H, 2001H
MOV B, M
LXI H, 2000H
MOV M, B
LXI H, 2001H
MOV M, A
HLT
🏁
T9
/
5️⃣
Sem 5
/
Practicals
Practicals
/
MI
MI
/
Lab 1

Lab 1

Lab 1 : PROGRAMMING BASED ON DATA TRANSFER AND ARITHMETIC OPERATIONS
OBJECTIVE
To familiar with the use of data transfer and arithmetic instruction set of 8085
PRELAB
Read data transfer  and arithmetic instructions from textbook in detail.
OVERVIEW OF DATA TRANSFER AND ARITHMETIC INSTRUCTIONS
Opcode
Operand
Description
MOV
Rd, Rs
Copies data from source register Rs to Rd
MVI
R, 8-bit
Copies 8-bit data to register R
LXI
Rp, 16-bit
Copies 16-bit data to register pair Rp
LXI
SP, 16-bit
Copies 16-bit data to stack pointer SP
MOV
R, M
Copies 8-bit data stored at memory location specified by the content of HL register to register R
LDAX
B/D
Copies 8-bit data stored at memory location specified by the content of BC or DE register to the accumulator
LDA
16-bit
Copies 8-bit data stored at memory location specified by 16-bit address to the accumulator
MOV
M, R
Copies data from a register R into the memory location specified by the HL pair
STAX
B/D
Stores the content of the accumulator to the memory location specified by the BC or DE pair
STA
16-bit
Stores the content of the accumulator to memory address
MVI
M, 8-bit
Stores 8-bit data to the memory location specified by the register pair HL
XCHG
Exchanges H and L with D and E respectively
ADD
R
Adds the content of register R to the content of the accumulator
ADI
8-bit
Adds the 8-bit data to the content of the accumulator
SUB
R
Subtracts the content of register R from the content of the accumulator
SUI
8-bit
Subtracts 8-bit data from the content of the accumulator
INR
R
Increases the content of register R by 1
DCR
R
Decreases the content of register R by 1
ADD
M
Adds the content of memory location specified by register pair HL to the content of the accumulator
SUB
M
Subtracts the content of memory location specified by register pair HL from the content of the accumulator
INR
M
Increments the content of the memory location specified by register pair HL by 1
DCR
M
Decrements the content of the memory location specified by register pair HL by 1
EXERCISES
1. Load the memory address 2100H with 0x45 and transfer it to accumulator. Copy accumulator to register B, C, D, E, H and L.
MVI A, 0x45
LXI H, 2100H
MOV M, A
MOV A, M
MOV B, A
MOV C, A
MOV D, A
MOV E, A
MOV H, A
MOV L, A
HLT
2. Load the accumulator with 0x45 and save accumulator at memory location 2105H.
MVI A, 0x45
LXI H, 2105H
MOV M, A
HLT
3. Write instructions to load 0x65 in register C and 0x92 in the accumulator. Store the content of both register at memory location 2122H and 2212H.
MVI C, 0x65
MVI A, 0x92
LXI H, 2122H
MOV M, C
LXI H, 2212H
MOV M, A
HLT
4. Write a program to exchange the content of B and C register.
MOV D, B
MOV B, C
MOV C, D
HLT
5. Write a program to exchange the content of memory location 2000H and 2001H.
LXI H, 2000H
MOV A, M
LXI H, 2001H
MOV B, M
LXI H, 2000H
MOV M, B
LXI H, 2001H
MOV M, A
HLT