answersLogoWhite

0


Best Answer

name "str2bin"

; convert string number to binary!

; this program written in 8086 assembly language to

; convert string value to binary form.

; this example is copied with major modifications

; from macro "scan_num" taken from c:\emu8086\inc\emu8086.inc

;

; the original "scan_num" not only converts the string number

; but also reads the string from the keyboard and supports

; backspace key, this example is a shorten version

; of original "scan_num" macro.

; here we assume that the string number is already given,

; and the string number does not contain non-digit chars

; and it cannot cause buffer overflow (number is in word range

; and/or has only 4 digits).

; negative values are allowed in this example.

; the original "scan_num" does not allow to enter non-digits

; and it also checks for buffer overflow.

; you can the original file with other macro definitions

; in c:\emu8086\inc\emu8086.inc

org 100h

jmp start

; text data:

msg1 db 0Dh,0Ah, " enter any number from -32768 to 65535 inclusive, or zero to stop: $"

msg2 db 0Dh,0Ah, " binary form: $"

; buffer for int 21h/0ah

; fist byte is buffer size,

; second byte is number of chars actually read (set by int 21h/0ah).

buffer db 7,?, 5 dup (0), 0, 0

; for result:

binary dw ?

start:

; print welcome message:

mov dx, offset msg1

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write assembly language to add two decimal number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program in 8086 assembly language to draw a circle?

You need an 8086 assembly language pencil.


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


How do you write assembly language?

Any text-editor will do.


How do you write 7.5 as a decimal number?

7.5 is a decimal.


What decimal number is equal to the decimal no 7 How do you reach the conclusion of 0111?

When you write the decimal number '7' in Base-2 (binary), you write '0111'.


Example of Password program code in assembly language?

How to write the program un Assembly language to set a password for personal computers?


How would you define assembly language?

assembly language uses abbreviation called menmonics.it is a bit easier to write computer programs in assembly language as compared to machine language but still requires skill and experienci.A program called assembler is used to convert an assembly language into machine language.


Assembly language program for string concatenation using 8086 microprocessor?

write program to concatenating two sting in 8086 assembly language


How do you write 127 in decimal number?

It is simply 127.0 as a decimal number


How do you write 1.0002 in decimal?

The number is in decimal notation.


Why high level language is slower then assembly language?

Programs written in a high level language might be slower than ones written in Assembly language; but it is not always so, it is very easy to write un-effective programs in Assembly.