CODE CONVERSION
BINARY TO BCD CONVERSION
AIM:
To write an assembly language program for the code conversion of binary to BCD Using 8085.
APPARATUS REQUIRED:
8085 kit, power chord
ALGORITHM:
1. Start the program
2. Clear D and E register
3. Load the data in memory location 4253 to the acc and compare the data with acc
4. Jump on carry to the address 4112
5. Subtract the data 64 H from acc
6. Compare immediately OAH with the acc and jump on carry to address 411D
7. Subtract immediately OAH with accumulator. Increment D register
8. Jump to address 4112 move accumulator data to register C move data to accumulator
9. Rotate left without carry by 4 numbers
10. Add data to Acc and store it in 4258
11. Move the data to accumulator and it stored
12. Stop the program
PROGRAM:
ADDRESS | LABEL | OPCODE | MNEMONICS | OPERAND | COMMENTS |
4100 | | 16,00 | MVI | D, 00 | Clear d register |
4102 | | 1E, 00 | MVI | E, 00 | Clear e register |
4104 | | 3A, 53,42 | LDA | 4253 | Load data to acc |
4107 | HUND | FE, 64 | CPI | 64H | Compare data with acc |
4109 | | DA, 12,41 | JC | TEN | Jump on carry to adder |
410C | | D6, 64 | SUI | 64 | Subtract data from acc |
410E | | 1C | INR | E | Increment e register |
410F | | C3, 07,41 | JMP | HUND | Jump to address |
4112 | TEN | FE, 0A | CPI | 0AH | Compare data with acc |
4114 | | DA, 1D, 41 | JC | UNIT | Jump on carry to adder |
4117 | | D6, 0A | SUI | 0AH | Subtract data with acc |
4119 | | 14 | INR | D | Increment d register |
411A | | C3, 12,41 | JMP | TEN | Jump to address |
411D | UNIT | 4F | MOV | C, A | Move acc to c register |
411E | | 7A | MOV | A, D | Move data to acc |
411F | | 07 | RLC | | Rotate left without cy |
4120 | | 07 | RLC | | Rotate left without cy |
4121 | | 07 | RLC | | Rotate left without cy |
4122 | | 07 | RLC | | Rotate left without cy |
4123 | | 81 | ADD | C | Add data to acc |
4124 | | 32,50,42 | STA | 4250 | Store the result |
4127 | | 7B | MOV | A, E | Move data to acc |
4128 | | 32 | STA, 51,42 | 4251 | Store the result |
412B | | 76 | HLT | | stop the process |
INPUT: 4253 – FF OUTPUT: 4250 – 55 4251 – 02
Thus the assembly language program for Binary to BCD code conversion is executed and the results are verified.
0 comments:
Post a Comment