sys_read
doesn't put anything "into the ecx
register". It puts text into a buffer pointed to by ecx
. It is ascii text, yes. The "enter" key (linefeed = 10 decimal = 0Ah) which ends input is included (so you've only got room for two digits). Given a well-behaved user, we may hope that it is an ascii representation of a decimal number. Might be a representation of a hex number... or might not be a number at all - depends on what the user enters.
To do arithmetic on this, you're going to have to convert it to a number. The computer happens to store this as binary, but think of it as "a number". "Decimal", "hex", etc. are ways of representing a number but it's the same number (linefeed, for example is 10 or 0Ah). If the user enters "42", assuming we mean this as decimal, thats 4 * 10 + 2, right? The character '4' is not the number 4, but can be converted by subtracting '0' (48 decimal or 30h - not the number 0!). Don't try to convert the linefeed, it's not part of our number.
After your calculation, you'll have to convert the number back into text before you can print it (presumably a decimal representation of the number - but you could print the result as hex... or octal or binary or something else).
This is about the most commonly asked question of all time, so you should be able to find examples.
You were doing pretty good up until add eax, 0
, which doesn't do anything (except set flags). You'll want to be working with single characters (one byte or 8 bits) for the "text" part, although the "number" could be bigger.