I am learning assembly programming using "8086 emu" (Its a software program . Emulator .) I am evaluating a basic expression -
a=b+c-d*e
My problem is that when I am using int 21h to take in values , Its taking only single digit (character) as input for each variable .
Also after the evaluation , I am unable to print the value stored in the variable 'a' on the output screen .
Can anyone give a solution for both the problems ?
For the first part (reading in a string until a sentinel key, e.g. the enter key is hit), you'll write a loop to do that.
A function for parsing the ASCII decimal string into a register value is also needed.
For printing to screen, you'll need:
int 21h, AH = 02h ( http://www.ctyme.com/intr/rb-2554.htm ) one character at a timeint 21h, AH = 09h ( http://www.ctyme.com/intr/rb-2562.htm ) one whole string You'll also need an itoa function (http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/) to convert a register value into a multi-digit ASCII string.
The URLs is part of an assembly programming tutorial called Ralf Brown's Interrupt List (RBIL).