8051- 8 Bit Division
8-Bit Division
THEORY:
- Using the accumulator, Division is performed and the result is stored.
- Immediate addressing is employed.
- The div instruction writes the result in the accumulator
INPUT:
- MOV A,# 08H
- MOV F0,#02H
OUTPUT:
- 8600 04H
- 8601 00H
PROGRAM:
ADDRESS | OPCODES | MNEMONICS | COMMENDS |
8500 | 74 08 | MOV A,#08 | |
8502 | 75 F0 02 | MOV F0,#02 | |
8505 | 84 | DIV AB | |
8506 | 90 86 00 | MOV DPTR,#8600 | |
8509 | F0 | MOVX @DPTR,A | |
850A | A3 | INC DPTR | |
850B | E5 F0 | MOV A,F0 | |
850D | F0 | MOVX @DPTR,A | |
850E | 80 FE | HERE: SJMP HERE |
Recent Comments