answersLogoWhite

0

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

12y ago

What else can I help you with?

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


How do you write assembly language?

Any text-editor will do.


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 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 to write number in ga language?

How to write number in ghanaian language


How do you write 75.6 as a decimal?

To write 75.6 as a decimal, you simply write the whole number part followed by a decimal point and then the decimal part. In this case, 75 is the whole number part, so you write it as 75., and then add the decimal part, which is .6. Therefore, 75.6 is the decimal representation of the number 75.6.


How do you write 127 in decimal number?

It is simply 127.0 as a decimal number


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