Problem: We are given a 16 bit decimal number we have to print the number in octal format.
Input: d1 = 16 Output:20 Input: d1 = 123 Output: 173
- Load the value stored into register
- Divide the value by 8 to convert it to octal
- Push the remainder into the stack
- Increase the count
- Repeat the steps until the value of the register is greater than 0
- Until the count is greater than zero
- POP the stack
- Add 48 to the top element to convert it into ASCII
- Print the character using interrupt
- Decrements the count
Note: The program cannot be run on an online editor, please use MASM to run the program and use dos box to run MASM, you might use any 8086 emulator to run the program.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- 8086 program to convert a 16 bit decimal number to binary
- 8086 program to convert a 16 bit decimal number to Hexadecimal
- 8086 program to Print a 16 bit Decimal number
- 8086 program to divide a 16 bit number by an 8 bit number
- 8086 program to reverse 8 bit number using 8 bit operation
- 8086 program to reverse 16 bit number using 8 bit operation
- 8086 program to convert an 8 bit BCD number into hexadecimal number
- 8086 program to convert 8 bit ASCII to BCD number
- 8086 program to convert 8 bit BCD number into ASCII Code
- Program for Octal to Decimal Conversion
- Program for Decimal to Octal Conversion
- 8086 program to find sum of digits of 8 bit number
- 8086 program to subtract two 16-bit numbers with or without borrow
- 8086 program to add two 16-bit numbers with or without carry
- 8086 program to multiply two 16-bit numbers
- 8086 program to add two 8 bit BCD numbers
- 8086 program to add two 16 bit BCD numbers with carry
- 8086 program to multiply two 8 bit numbers
- 8086 program to subtract two 8 bit BCD numbers
- 8086 program to subtract two 16 bit BCD numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.