INDEX
S.no Experiment Page No. Remarks1. Write a program to place 08H into the
register B then move it to register C.8
2. Write a program to load the contents of memory location 8020H to the accumulator and then transfer it to register B.
9
3. Write a program to load 23H to the accumulator and then store it in memory location FC40H.
10
4. Write a program to transfer 16-bit no. of the memory location 8014H and 8015H into the register pair H-L.
11
5. Write a program to load the contents of memory location stored in register pair D-E to the accumulator.
12
6. Write a program to add the contents of register C with the contents of register D.
13
7. Write a program to add the content of register C to the content of memory location 8013H.
14
8. Write a program to add the data 06H to the contents of memory location 8013H.
15
9. Write a program to subtract the contents of register C from the accumulator.
16
10. Write a program to subtract the contents of memory location 8013H from the accumulator.
17
11. Write a program to load 09H into accumulator & data 2CH to register B.
18
12. Write a program to subtract the data 06H from the contents of memory location 8013H.
19
13. Write a program to add two 8-bit numbers, one is stored in 9005H, other is stored in 9006H and result must be stored at 9007H and 9008H which is of 9-bit.
20
14. Write a program to add two 8-bit numbers 22
1
and result is 16-bit number. Assume that one number is stored at 9004H and other is stored at 9005H and result is stored at 9006H, 9007H.
15. Write a program to subtract two 8-bit numbers and result is 16-bit number. Assume that one number is stored at 9004H and other is stored at 9005H and result is stored at 9006H, 9007H.
24
16. Write a program to add the two 16-bit numbers and result as 16-bit number.
26
17. Write a program to add the two 16-bit numbers and result as 24-bit number.
28
18. WAP to find larger number from two given numbers. One number is in 8013H and other in register D.
30
19. WAP to find smaller number from two given numbers. One number is in 8007H and other in register E and result 8009H.
32
20. WAP to find 1’s complement of 8 bit number which is stored in location 8014H.
34
21. WAP to transfer a block of five bytes from starting address 8000H to 9000H.
35
22. WAP to find 2’s complement of 8 bit number which is stored in location 8014H.
37
23. WAP to find 1’s complement of 16 bit number which is stored in location 9002H and 9003H.
38
24. WAP to find 2’s complement of 16 bit number which is stored in location 9002H and 9003H.
40
2
Microprocessor
Microprocessor is an electronic device [driven by a clock] which takes instruction in the form of binary data, process it and give the output. A microprocessor incorporates most or all of the functions of a computer's central processing unit (CPU) on a single integrated circuit.
8085 microprocessor
The Intel 8085 is an 8-bit microprocessor introduced by Intel in 1977. It was binary-compatible with the more-famous Intel 8080 but required less supporting hardware, thus allowing simpler and less expensive microcomputer systems to be built. The 8085 is a conventional von Neumann design based on the Intel 8080. Unlike the 8080 it had no state signals multiplexed onto the data bus, but the 8-bit data bus was instead multiplexed with the lower part of the 16-bit address bus (in order to limit the number of pins to 40). The processor was designed using nMOS circuitry. The 8085 had extensions to support new interrupts: It had three maskable interrupts (RST 7.5, RST 6.5 and RST 5.5), one Non-Maskable interrupt (TRAP), and one externally serviced interrupt (INTR). Like the 8080, the 8085 could accommodate slower memories through externally generated wait states (pin 35, READY), and had provisions for Direct Memory Access (DMA) using HOLD and HLDA signals (pins 39 and 38).
3
Block diagram (8085)
Instructions:
Instruction is a command which is given to the computer to perform a specified operation on the given data. An instruction is a single operation of a processor defined by an instruction set architecture.
Types of instructions:
One-byte instructions: A 1-byte instruction includes the opcode and the operand in the same byte. E.g. MOV C,A. These instructions are stored in 8-bit binary format in memory; each requires one memory location.
Two-byte instructions: In a 2-byte instruction, the first byte specifies the operation code and the second byte specifies the operand. E.g. MVI A,32H. These instructions would require two memory locations each to store the binary codes.
Three-byte instructions: IN a 3-byte instruction, the first byte specifies the opcode, and the following two bytes specify the 16-bit address. Note that the second byte is
4
low-order address and the third byte is the high-order address. E.g. LDA 2050H. These instructions would require three memory locations each to store the binary codes.
Addressing modes of 8085:
The various formats for specifying operands are called the addressing modes. Various addressing modes in 8085 are:
1. Direct addressing : In this addressing mode the address of the data is given in the instruction itself. E.g. LDA 8205H
2. Register Addressing : In this mode the operand is specified in one of the general purpose register. E.g. MOV A,C
3. Register indirect addressing : In this mode, the address of the operand is given in the register pair. E.g. LDAX B
4. Immediate addressing : In this mode, the 8 bit data is specified itself in the instruction. E.g. MVI B,05H
5. Implicit addressing : In this mode the operation operate on the contents of the accumulator. E.g. RAR (rotate the contents of accumulator to right).
5
Instructions of 8085:
Data transfer Instructions: 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
Arithmetic Instructions:
The arithmetic instructions add, subtract, increment, or decrement data in registers or memory.
ADD Add to Accumulator
ADI Add Immediate Data to Accumulator
ADC Add to Accumulator Using Carry Flag
ACI Add immediate data to Accumulator Using Carry
SUB Subtract from Accumulator
6
SUI Subtract Immediate Data from Accumulator
SBB Subtract from Accumulator Using Borrow (Carry) Flag
SBI Subtract Immediate from Accumulator Using Borrow (Carry) Flag
INR Increment Specified Byte by One
DCR Decrement Specified Byte by One
INX Increment Register Pair by One
DCX Decrement Register Pair by One
DAD Double Register Add; Add Content of Register Pair to H & L Register Pair
Logical instruction :
This group performs logical (Boolean) operations on data in registers and memory and on condition flags. The logical AND, OR, and Exclusive OR instructions enable you to set specific bits in the accumulator ON or OFF.
ANA Logical AND with Accumulator
ANI Logical AND with Accumulator Using Immediate Data
ORA Logical OR with Accumulator
ORI Logical OR with Accumulator Using Immediate Data
XRA Exclusive Logical OR with Accumulator
XRI Exclusive OR Using Immediate Data
The Compare instructions compare the content of an 8-bit value with the contents of the accumulator;
CMP Compare
CPI Compare Using Immediate Data
7
The rotate instructions shift the contents of the accumulator one bit position to the left or right:
RLC Rotate Accumulator Left
RRC Rotate Accumulator Right
RAL Rotate Left through Carry
RAR Rotate Right through Carry
Complement and carry flag instructions:
CMA Complement Accumulator
CMC Complement Carry Flag
STC Set Carry Flag
Branch Instructions:
The branching instructions alter normal sequential program flow, either unconditionally or conditionally. The unconditional branching instructions are as follows:
JMP Jump
CALL Call
RET Return
Thus, the conditional branching instructions are specified as follows:
Jumps Calls Returns
C CC RC (Carry)
INC CNC RNC (No Carry)
JZ CZ RZ (Zero)
JNZ CNZ RNZ (Not Zero)
JP CP RP (Plus)
8
EXPERIMENT NO. 1
AIM: Write a program to place 08H into the register B then move it to register C.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MVI r,8-bits: Move the immediate data to the specified register2. MOV R1,R2: Copy the data from register R2 to register R1.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 0608
MVI B,08H Move the immediate data to register B
8002 48 MOV C,B Copies the data from register B to register C
8003 76 HLT STOP
EXPERIMENT NO. 2
10
AIM: Write a program to load the contents of memory location 8020H to the accumulator and then transfer it to register B.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LDA 16-bit address: Load the contents of 16-bit address to the accumulator.2. MOV R1,R2: Copy the data from register R2 to register R1.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A2080
LDA 8020H Load the contents of memory location 8020H to the accumulator
8003 47 MOV B,A Copies the data from accumulator to register B
8004 76 HLT STOP
EXPERIMENT NO. 3
11
AIM: Write a program to load 23H to the accumulator and then store it in memory location FC40H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MVI r,8-bits: Move the immediate data to the specified register2. STA 16-bit address: Store the contents of accumulator the 16-bit address.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3E23
MVI A,23H Move the immediate data to register B
8002 3240FC
STA FC40H Store the contents of accumulator to the memory location FC40H
8005 76 HLT STOP
EXPERIMENT NO. 4
12
AIM: Write a program to transfer 16-bit no. of the memory location 8014H and 8015H into the register pair H-L
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LHLD 16-bit address: Load the H-L register with the contents of memory
location given in the instruction say m and m+1 such as Lm and Hm+1.2. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 2A1480
LHLD 8014H Move the contents of 8014H to register L and contents of 8015H to register H
8003 76 HLT STOP
EXPERIMENT NO. 5
13
AIM: Write a program to load the contents of memory location stored in register pair D-E to the accumulator.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LDAX rp: Load the accumulator with the contents of memory location
whose address is specified in the given register pair 2. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 1A LDAX D Load to the accumulator the contents of memory location whose address is specified in register pair D-E
8001 76 HLT STOP
EXPERIMENT NO. 6
14
AIM: Write a program to add the contents of register C with the contents of register D.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MOV R1,R2: Move the contents of register R2 to register R1.2. ADD R3: Add the contents of specified register to accumulator and store the
result to accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 79 MOV A,C Move the contents of register C to accumulator
8001 82 ADD D Add the contents of register D to the contents of accumulator
8002 76 HLT STOP
EXPERIMENT NO. 7
15
AIM: Write a program to add the content of register C to the content of memory location 8013H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LDA 16-bit address: Load the contents of 16-bit address to the accumulator.2. ADD R: Add the contents of specified register to accumulator and store the
result to accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1380
LDA 8013H Load the contents of memory location 8013H to the accumulator
8003 81 ADD C Add the contents of register C to the contents of accumulator
8004 76 HLT STOP
EXPERIMENT NO. 8
16
AIM: Write a program to add the data 06H to the contents of memory location 8013H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LDA 16-bit address: Load the contents of 16-bit address to the accumulator.2. ADI 8-bit data: Add the immediate data to accumulator and store the result
to accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1380
LDA 8013H Load the contents of memory location 8013H to the accumulator
8003 C606
ADI 06 Add the immediate data to the contents of accumulator
8005 76 HLT STOP
EXPERIMENT NO. 9
AIM: Write a program to subtract the contents of register C from the accumulator.
17
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:1. SUB R: Subtract the contents of specified register from the accumulator and
store the result to accumulator.2. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 91 SUB C Subtract the contents of register C from the contents of accumulator
8001 76 HLT STOP
EXPERIMENT NO. 10
AIM: Write a program to subtract the contents of memory location 8013H from the accumulator.
18
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:1. LXI H, 16-bit address: Move the 16-bit address to register pair H-L.2. SUB M: Subtract the contents of memory location specified by H-L pair
from the accumulator and store the result to accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 211380
LXI H,8013H Move the immediate 16-bit data to H-L pair
8003 96 SUB M Subtract the contents of memory location specified by H-L pair from the contents of accumulator
8004 76 HLT STOP
EXPERIMENT NO. 11
AIM: Write a program to load 09H into accumulator & data 2CH to register B.
APPARATUS: Battery, 8085 kit, power supply 220V.
19
INSTRUCTIONS USED: 1. MVI r, 8-bits: Move the immediate data to the specified register.2. MVI r, 8-bits: Move the immediate data to the specified register.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3E09
MVI A,09H Move the immediate data to register A
8002 062C
MVI B,2CH Move the immediate data to register B
8004 76 HLT STOP
EXPERIMENT NO. 12
AIM: Write a program to subtract the data 06H from the contents of memory location 8013H.
APPARATUS: Battery, 8085 kit, power supply 220V.
20
INSTRUCTIONS USED: 1. LDA 16-bit address: Load the contents of 16-bit address to the accumulator.2. SBI 8-bit data: Subtract the immediate data to accumulator and store the
result to accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1380
LDA 8013H Load the contents of memory location 8013H to the accumulator
800306
SBI 06 Subtract the immediate data from the contents of accumulator
8005 76 HLT STOP
EXPERIMENT NO. 13
AIM: Write a program to add two 8-bit numbers, one is stored in 9005H, other is stored in 9006H and result must be stored at 9007H and 9008H which is of 9-bit.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
21
1. LDA 16-bit address: Loads the accumulator with the contents of the specified memory location.
2. LXI H, 16-bit data: Loads 16 bit data in register pair designated by operand.3. ADD M: Add the contents of memory to accumulator.4. STA 16-bit address: Copies the contents of the accumulator to the memory
location specified in the instruction.5. MVI A, 8-bit data: Copies the 8-bit data to accumulator.6. ADC A: Add the contents of register and carry flag to contents of accumulator
and result is stored in accumulator.7. HLT: Finishes the execution of the current instruction and stops any further
execution.
MEMORY ADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A0590
LDA 9005 H LOADS ACCUMULATOR WITH CONTENTS OF 9005.
8003 210690
LXI H, 9006 LOADS THE ADDRESS OF NO. IN HL PAIR.
8006 86 ADD M ADD CONTENTS OF MEMORY TO CONTENTS OF ACCUMULATOR.
8007 320790
STA 9007 H STORES THE RESULT AT 9007 H.
800A 3E00
MVI A,00 MOVES 8-BIT DADTA TO ACCUMULATOR.
800C 8F ADC A ADDS CONTENTS OF REGISTER AND CARRY FLAG TO CONTENTS OF ACCUMULATOR AND STORE IN ACCUMULATOR.
800D 320890
STA 9008 STORES THE RESULT AT 9008 H.
22
8010 76 HLT STOP.
EXPERIMENT NO. 14
AIM: Write a program to add two 8-bit numbers and result is 16-bit number. Assume that one number is stored at 9004H and other is stored at 9005H and result is stored at 9006H, 9007H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MVI B, 8-bit data: Copies the 8-bit data to register B.
23
2. LXI H, 16-bit data: Loads 16 bit data in register pair designated by operand.3. MOV A, M: Copies the data byte into the accumulator from the memory.4. INX H: Increments the contents of register pair by 1 and store the result in the
same register pair.5. ADD M: Add the contents of memory to accumulator.6. JNC A1: Jumps on no carry.7. INR B: Increments the contents of register by 1 and stores in the same register.8. STA 16-bit address: Copies the contents of the accumulator to the memory
location specified in the instruction.9. MOV A, B: Copies the data byte into the accumulator from the register.10.HLT: Finishes the execution of the current instruction and stops any further
execution.
MEMORY ADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 0600
MVI B,00 MOVES THE 8-BIT DATA TO ACCUMULATOR.
8002 210490
LXI H, 9004 LOADS THE ADDRESS OF NO. IN HL PAIR.
8005 7E MOV A,M MOVES CONTENTS OF MEMORY TO ACCUMULATOR.
8006 23 INX H INCREMENT CONENT OF REG. PAIR BY 1 AND STORE IT IN REG PAIR.
8007 86 ADD M ADD CONTENTS OF MEMORY TO CONTENTS OF ACCUMULATOR.
8008 D20C80
JNC A1 JUMP ON NO CARRY.
800B 04 INR B INCREMENT CONENT
24
OF REG. B BY 1 AND STORE IT IN REG. B.
800C 320690
A1: STA 9006 H STORES THE RESULT AT 9006 H.
800F 7B MOV A,B MOVES CONTENTS OF REGISTER TO ACCUMULATOR.
8010 320790
STA 9007 STORES THE RESULT AT 9007 H.
8013 76 HLT STOP.
EXPERIMENT NO. 15
AIM: Write a program to subtract two 8-bit numbers and result is 16-bit number. Assume that one number is stored at 9004H and other is stored at 9005H and result is stored at 9006H, 9007H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MVI R, 8-bit data: Copies the 8-bit data to register B.2. LXI R, 16-bit data: Loads 16 bit data in register pair designated by operand.
25
3. MOV R, M: Copies the data byte into the accumulator from the memory.4. INX rp: Increments the contents of register pair by 1 and store the result in the
same register pair.5. SUB M: Subtract the contents of memory from accumulator.6. JNC A1: Jumps on no carry.7. INR R: Increments the contents of register by 1 and stores in the same register.8. STA 16-bit address: Copies the contents of the accumulator to the memory
location specified in the instruction.9. MOV R1, R2: Copies the data byte into the accumulator from the register.10.HLT: Finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 0600
MVI B,00 MOVES THE 8-BIT DATA TO REGISTER B.
8002 210490
LXI H, 9004 LOADS THE ADDRESS OF NO. IN HL PAIR.
8005 7E MOV A,M MOVES CONTENTS OF MEMORY TO ACCUMULATOR.
8006 23 INX H INCREMENT CONENT OF REG. PAIR BY 1 AND STORE IT IN REG PAIR.
8007 96 SUB M SUBTRACT CONTENTS OF MEMORY FROM CONTENTS OF ACCUMULATOR.
8008 D20C80
JNC A1 JUMP ON NO CARRY.
800B 04 INR B INCREMENT CONENT OF REG. B BY 1 AND STORE IT IN REG. B.
800C 3206
A1: STA 9006 H STORES THE RESULT AT 9006 H.
26
90800F 7B MOV A,B MOVES CONTENTS OF
REGISTER TO ACCUMULATOR.
8010 320790
STA 9007 STORES THE RESULT AT 9007 H.
8013 76 HLT STOP.
EXPERIMENT NO. 16
AIM: Write a program to add the two 16-bit numbers and result as 16-bit number.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. LHLD 16-bit address: Copies the contents of the memory location pointed out
by the 16-bit address into register L and copies the contents of the next memory location into register H.
2. XCHG: Exchanges the contents of register H with the contents of register D, and the contents of register L with the contents of register E.
3. DAD register pair: Add the 16-bit contents of the specified register pair to the contents of the HL register and the sum is stored in the HL register.
27
4. SHLD 16-bit address: Stores the contents of register L into the memory location specified by the 16-bit address in the operand and the contents of H register into the next memory location by incrementing the operand.
5. HLT: Finishes the execution of the current instruction and stops any further execution.
MEMORY ADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 2A0390
LHLD 9003 H COPIES CONTENTS OF MEMORY LOCATION 9003 TO REG. L AND COPIES CONTENTS OF NEXT MEMORY LOCATION TO REG H.
8003 EB XCHG EXCHANGES THE CONTENTS OF H-L PAIR WITH D-E PAIR.
8004 2A0590
LHLD 9005 COPIES CONTENTS OF MEMORY LOCATION 9005 TO REG. L AND COPIES CONTENTS OF NEXT MEMORY LOCATION TO REG H.
8007 19 DAD D ADDS THE CONTENTS OF REGISTER PAIR WITH THE CONTENTS OF H-L PAIR.
8008 220890
SHLD 9008 STORES THE CONTENTS OF REG L TO MEMORY LOC. 9008 AND CONTENTS OF REG H ARE STORED AT NEXT MEMORY LOC.
800B 76 HLT STOP.
28
EXPERIMENT NO. 17
AIM: Write a program to add the two 16-bit numbers and result as 24-bit number.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED: 1. MVI R, 8-bit data: Copies the 8-bit data to register B.2. LHLD 16-bit address: Copies the contents of the memory location pointed
out by the 16-bit address into register L and copies the contents of the next memory location into register H.
3. XCHG: Exchanges the contents of register H with the contents of register D, and the contents of register L with the contents of register E.
4. DAD register pair: Add the 16-bit contents of the specified register pair to the contents of the HL register and the sum is stored in the HL register.
5. JNC A1: Jumps on no carry.6. INR R: Increments the contents of register by 1 and stores in the same
register.
29
7. SHLD 16-bit address: Stores the contents of register L into the memory location specified by the 16-bit address in the operand and the contents of H register into the next memory location by incrementing the operand.
8. MOV R1,R2: Copies the data byte into the accumulator from the register.9. STA 16-bit address: Copies the contents of the accumulator to the memory
location specified in the instruction.10.HLT: Finishes the execution of the current instruction and stops any further
execution.
MEMORY ADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 0600
MVI B,00 MOVES THE 8-BIT DATA TO REGISTER B.
8002 2A0390
LHLD 9003 H COPIES CONTENTS OF MEMORY LOCATION 9003 TO REG. L AND COPIES CONTENTS OF NEXT MEMORY LOCATION TO REG H.
8005 EB XCHG EXCHANGES THE CONTENTS OF H-L PAIR WITH D-E PAIR.
8006 2A0590
LHLD 9005 H COPIES CONTENTS OF MEMORY LOCATION 9005 TO REG. L AND COPIES CONTENTS OF NEXT MEMORY LOCATION TO REG H.
8009 19 DAD D ADDS THE CONTENTS OF REGISTER PAIR WITH THE CONTENTS OF H-L PAIR.
800A D20E80
JNC A1 JUMP ON NO CARRY.
800D 04 INR B INCREMENT CONENT OF REG. B BY 1 AND STORE IT IN REG. B.
800E 2208
A1: SHLD 9008 H STOES THE CONTENTS OF REG L TO MEMORY
30
90 LOC. 9008 AND CONTENTS OF REG H ARE STORED AT NEXT MEMORY LOC.
8011 7B MOV A,B MOVES CONTENTS OF REGISTER TO ACCUMULATOR.
8012 321090
STA 9010 H STORES THE RESULT AT 9010 H.
8015 76 HLT STOP.
EXPERIMENT NO: 18
AIM: WAP to find larger number from two given numbers. One number is in 8013H and other in register D.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. LDA 16-bit address: Load the data in 16-bit address into the accumulator.2. CMP r: Contents of register are compared to accumulator.3. JNC 16-bit address: Program execution is transferred to the specified
address if the carry flag is not set.4. MOV r1,r2: Copies the contents from register r2 to register r1.5. INR r: Contents of register are incremented by one.6. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1380
LDA 8013H Loads the data in 8013H into accumulator.
31
8003 BA CMP D Compare the accumulator withContents of register D.
8004 D20880
JNC 8008H Jump if the carry flag is not set
8007 04 INR B Increments register B by one.
8008 7A MOV A,D Copy the contents of register D into accumulator.
8009 47 MOV B,A Copy the contents of accumulator into register B.
800A 76 HLT STOP
32
EXPERIMENT NO: 19
AIM: WAP to find smaller number from two given numbers. One number is in 8007H and other in register E and result 8009H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. LDA 16-bit address: Load the data in 16-bit address into the accumulator.2. CMP r: Contents of register are compared to accumulator.3. JC 16-bit address: Program execution is transferred to the specified address
if the carry flag is set.4. MOV r1,r2: Copies the contents from register r2 to register r1.5. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A0780
LDA 8007H Loads the data in 8007H into the accumulator
8003 B8 CMP B Compare the accumulator with theContents of register B.
8004 D20880
JC 8008H Jump if the carry flag is not set
8007 78 MOV A,B Copy the contents of register B into accumulator.
8008 4F MOV C,A Copy the contents of accumulator into register C.
8009 3209
STA 8009H Store the contents of accumulator to
34
EXPERIMENT NO: 20
AIM: WAP to find 1’s complement of 8 bit number which is stored in location 8014H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. LDA 16-bit address: Load the data in 16-bit address into the accumulator.2. CMA: complements the contents of accumulator.3. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1480
LDA 8014H Loads the data in 8014H into accumulator
8003 2F CMA Complement accumulator
8004 76 HLT STOP
EXPERIMENT NO: 21
36
AIM: WAP to transfer a block of five bytes from starting address 8000H to 9000H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. MVI r: Copy the data in to the register.2. LXI rp, 16-bit: Loads 16 bit data/address in register pair designated by
operand.3. MOV r1, r2: Copies the contents from register r2 to register r1.4. INX rp: Contents of register pair are incremented by one.5. STAX rp: Store accumulator contents in address in register pair.6. DCR r: Contents of the register are decremented by one.7. JNZ 16-bit address: Program execution is transferred to the specified address
if the zero flag is not set.8. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 0E05
MVI C,05H Copies the data into the register C
8002 210080
LXI H,8000H Load the specified address in H-L pair
8005 110090
LXI D,9000H Load the specified address in D-E pair
8006 7E MOV A,M Copies the contents from memory to accumulator
8009 23 INX H Increments H-L pair by one
800A 12 STAX D Store contents to D-E
37
specified address.
800B 13 INX D Increments D-E pair by one
800C 0D DCR C Decrements reg. c by one
800D C20F80
JNZ 800FH Jump if the content of reg. C is not zero
8010 76 HLT STOP
EXPERIMENT NO: 22
AIM: WAP to find 2’s complement of 8 bit number which is stored in location 8014H.
38
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. LDA 16-bit address: Load the data in 16-bit address into the accumulator.2. CMA: complements the contents of accumulator.3. INR A: Increments the contents of register by 1 and stores in the same
register.4. STA 16-bit address: Copies the contents of the accumulator to the memory
location specified in the instruction.5. HLT: finishes the execution of the current instruction and stops any further
execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 3A1480
LDA 8014H Loads the data in 8014H into accumulator
8003 2F CMA Complement accumulator
8004 3C INR A Increments the contents of register by 1 and stores in the same reg.
8005 321480
STA 8014 H Stores the result
8008 76 HLT STOP
EXPERIMENT NO: 23
AIM: WAP to find 1’s complement of 16 bit number which is stored in location 9002H and 9003H.
39
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
1. LHLD 16-bit address: Load the H-L register with the contents of memory location given in the instruction say m and m+1 such as Lm and Hm+1.
2. MOV R1,R2: Copy the data from register R2 to register R1.3. CMA: complements the contents of accumulator.4. MOV R1,R2: Copy the data from register R2 to register R1.5. MOV R1,R2: Copy the data from register R2 to register R1.6. CMA: complements the contents of accumulator.7. MOV R1,R2: Copy the data from register R2 to register R1.8. SHLD 16-bit address: Stores the contents of register L into the memory
location specified by the 16-bit address in the operand and the contents of H register into the next memory location by incrementing the operand
9. HLT: finishes the execution of the current instruction and stops any further execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 2A0290
LHLD 9002H Move the contents of 9002H to register L and contents of 9003H to register H
8003 7D MOV A,L Copy the contents of register L into accumulator
8004 2F CMA Complement accumulator
8005 6F MOV L,A Copy the contents of accumulator into register L
8006 7C MOV A,H Copy the contents of
40
register H into accumulator
8007 2F CMA Complement accumulator
8008 67 MOV H,A Copy the contents of accumulator into register L
8009 220290
SHLD 9002 Store the contents of register L to 9002H and contents of register H to 9003H
800C 76 HLT STOP
EXPERIMENT NO: 24
AIM: WAP to find 2’s complement of 16 bit number which is stored in location 9002H and 9003H.
APPARATUS: Battery, 8085 kit, power supply 220V.
INSTRUCTIONS USED:
41
1. LHLD 16-bit address: Load the H-L register with the contents of memory location given in the instruction say m and m+1 such as Lm and Hm+1.
2. MOV R1,R2: Copy the data from register R2 to register R1.3. CMA: complements the contents of accumulator.4. MOV R1,R2: Copy the data from register R2 to register R1.5. MOV R1,R2: Copy the data from register R2 to register R1.6. CMA: complements the contents of accumulator.7. MOV R1,R2: Copy the data from register R2 to register R1.8. INX rp: Increments the contents of register pair by 1 and store the result in
the same register pair.9. SHLD 16-bit address: Stores the contents of register L into the memory
location specified by the 16-bit address in the operand and the contents of H register into the next memory location by incrementing the operand
10.HLT: finishes the execution of the current instruction and stops any further execution.
MEMORYADDRESS
MACHINE CODES
MNEMONICS OPERANDS COMMENTS
8000 2A0290
LHLD 9002H Move the contents of 9002H to register L and contents of 9003H to register H
8003 7D MOV A,L Copy the contents of register L into accumulator
8004 2F CMA Complement accumulator
8005 6F MOV L,A Copy the contents of accumulator into register L
8006 7C MOV A,H Copy the contents of register H into accumulator
42