Write an 8085 program to combine two nibbles to form a byte
In the last program, we saw how we can separate a byte into two nibbles. In this program, we are going to learn how we can combine two nibbles to form a byte.
So, basically, this program is just the opposite of the last program. And this program, we are going to use immediate addressing mode.
Like the last program, we are going to need two memory locations; 2000H for storing the first nibble, and in the 2001H memory location, we will store the other nibble.
And in the 2002H memory location, we are going to store the result.
LXI H,2000H //using LXI instruction, we will use HL register as a pointer to point to the content of 2000H
MOV A,M //using MOV instruction we will copy the content of memory location to accumulator
RRC //using RRC instruction we will rotate the content i.e. 04H
ORI 05H //finally we will perform the OR operation with 05H
STA 2002 //now we will store the result at 2002H
|Memory Location||OPCODE||Operand||Label||Hex Code|