hi & happy new year everybody
assmbly read char from keyboard with int 21.1 and show string with 21.9
how can i read and write number such as number not char or string in assembly?
which interrupt i have to use it?
Posted on 2010-01-01 14:45:19 by rtslan
New year, same questions... sigh. :)

Doesn't matter which interrupt you use - they all deal with characters, not numbers. You'll have to convert from a "string representing a number" to a number, and back from a number to a string representing that number. For a single digit, just subtract '0' (0x30, 48 decimal) from an ascii character - provided it's a decimal digit - to get to a number, and add '0' to a number to convert to the character representing that number. For multiple digits, you'll have to multiply or divide by ten as you go along. Surely there's an example around here someplace!(?) If you use int 21.9 to display the string, don't forget to $-terminate it!


Posted on 2010-01-01 16:05:45 by fbkotler