8085 program to Unpack the BCD number and store the two digits in memory locations
Two digit BCD number is stored in memory location 4200H. Unpack the BCD
number and store the two digits in memory locations 4300H and 4301H such that
memory location 4300H will have lower BCD digit.
Note : For following example we have changed addresses.
0700 91
LDA 0700 #A = 91 || 0701 = 00 || 0702 = 00
ANI 0F #A = 01 || 0701 = 00 || 0702 = 00
STA 0701 #A = 01 || 0701 = 01 || 0702 = 00
LDA 0700 #A = 91 || 0701 = 01 || 0702 = 00
ANI F0 #A = 90 || 0701 = 01 || 0702 = 00
RRC #A = 48
RRC #A = 24
RRC #A = 12
RRC #A = 09
STA 0702 #A = 09|| 0701 = 01 || 0702 = 09
HLT
LDA 0700 – A 24 bits (3 bytes) command which will load content of memory location 0700 in register A i.e. Accumulator.
ANI 0F – It stands for “AND Immediate with Accumulator”. It will perform AND operation of operand with content of Accumulator. In this case 91 AND 0F.
STA 0701 – A 24 bits command which will store data of accumulator in memory location 0701.
ANI F0 – It stands for “AND Immediate with Accumulator”. It will perform AND operation of operand with content of Accumulator. In this case 91 AND F0.
RRC – It stands for “Rotate Right Accumulator”. it will rotate the Accumulator current content to the right by 1-bit position. LSB bit will be shifted in MSB and Carry Flag.
STA 0702 – A 24 bits command which will store data of accumulator in memory location 0702.
HTL – It means Halt the microprocessor.
Program to unpack BCD number in 8085
Click here to check out FYIT OOP practical
Checkout Other Microprocessor Architecture Practical Program
Checkout Other Microprocessor Architecture Quiz
Microprocessor, microcomputers, and Assembly Language |
1 – Best Microprocessor Architecture Quiz on chapter 1 |
2 – Best Quiz on Microprocessor Architecture chapter 1 |
Introduction to 8085 Assembly Language Programming |
1 – Easy Quiz on 8085 Assembly Language Programming |
2 – Easy Quiz on 8085 Assembly Language Programming |
Microprocessor Architecture and Microcomputer System |
1 – Easy Microprocessor Architecture and Microcomputer System Quiz |
8085 Microprocessor Architecture and Memory Interface |
1 – Easy quiz on 8085 Microprocessor Architecture and Memory Interfacing |
Interfacing of I/O Devices |
1 – Easy quiz on 8085 Interfacing of I/O Devices |
Introduction to 8085 Instructions |
1 – Easy quiz on 8085 Instructions |
More coming soon… stay tune |
