Write an assembly language program to perform arithmetic operations of two BCD numbers
ApparatusDyna 8086 microprocessor kit.
Theory:Here multiplication of two BCD numbers is demonstrated.
Program:Here multiplication of two BCD numbers is demonstrated.
- Press RES
- Press SEG (EB/AX) 0100 then Press INR
- OFF 0100 then Press INR
- Start entering the Op Codes as:
B0 05 B7 09 F6 E7 D4 0A CC 00
- Press INR after entering each byte.
- The program corresponding to the above mentioned Op Codes is as below:
| Address | Opcode | Mnemonics Operand | Comments |
| 0100 | B0 05 | MOV AL, 5 | Load unpacked BCD 05H in AL |
| 0102 | B7 09 | MOV BH, 9 | Load unpacked BCD 09H in BH |
| 0104 | F6 E7 | MUL BH | Multiply AL with BH, result in AX |
| 0106 | D4 0A | AAM | AAM (BCD Adjust After Multiply) instruction adjusts the BCD after multiply. |
| 0108 | CC | INT 3 (Hold) | Load Data bytes which are in location 0500 and 0501 in 16 bit ACC. i.e. (0500) – AH (0501) – AL. |
- Press EXEC
- Press GO
- SEG 0100 Press EXEC
- START 0100 Press EXEC
- Br 0108 Press EXEC
- F will be displayed
- View Result in register by pressing REG and AX
Result:
Data Output
AL=05H (Unpacked BCD) AX=45H (Packed BCD)
AH=09H (Unpacked BCD)
Viva Questions:
Get all latest content delivered to your email a few times a month.
Resources: