answersLogoWhite

0

Dis macro str mov ah,09h lea dx,str int 21h endm data segment msg2 db "binary number is : $" str1 db 20 dup('$') str2 db 20 dup('$') no dw 100 line db 10,13,'$' data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax lea si,str1 mov ax,no mov bh,00 mov bl,2 l1:div bl add ah,'0' mov byte ptr[si],ah mov ah,00 inc si inc bh cmp al,00 jne l1 mov cl,bh lea si,str1 lea di,str2 mov ch,00 add si,cx dec si l2:mov ah,byte ptr[si] mov byte ptr[di],ah dec si inc di loop l2 dis line dis msg2 dis str2 mov ah,4ch int 21h code ends end start ;------ ;output ;------ binary number is : 1100100

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin

Add your answer:

Earn +20 pts
Q: Write an assembly language program to convert bcd number to decimal?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

How do you draw a circle in assembly program?

You can draw a circle in assembly program by using a compass-like tool. Secure the tip of the compass and then rotate the compass tool so that it completes the circle.


Where is the percentage button on the TI-83 plus?

Does not exist. The only way to get the percentage character is to use an assembly program that lets you access "hidden" characters. If you just need to convert a number to a percentage, just divide the number by 100.


What is the formula for adding fractions with variable?

In order to add a fraction to a variable the fraction must be converted to decimal as computers cannot understand fractions, thats why they have floating points. On the other hand you could produce an answer in decimal and then convert it into a fraction afterwards but it would be overly complicated for a program to do this. I suggest if you are seriously into this somewhat eccentric behaviour you should try the program Mathematica from Wolfram research which is very expensive.


Write an assembly language program to find 2's complement of a number FFH?

Code for An Assembly Language Program to find 2's Complement of given binary number in Assembly LanguageData Segment num db 00000010B Data Ends Code Segment Assume cs:code, ds:data Begin: mov ax, data mov ds, ax mov es, ax mov ah, 0000h mov al, num NOT al mov bl, al adc al, 00000001B mov bl, al Exit: mov ax, 4c00h int 21h Code Ends End Begin


What is the sum of the binary addition 1010 plus 1101?

The person above answered by converting to decimal. Since our normal algebraic rules are designed for base-10 (ever try dividing in hex?) I suggest using the Calc program in Windows. Start the program, and in View, change the mode to Scientific. You will see one box called "Dec" selected. That is decimal notation. There is Hex for hexadecimal and Bin for binary. Click Bin, type in 1010, click +, type 1101, and press enter. FYI, if you now click Dec you will instantly convert the answer (10111) to decimal (23.)