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
Chat with our AI personalities
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.
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.
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.
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
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.)