Why is my assembly output in letter position? (1+1=b)

Your input digits are ASCII characters, so ‘1’ is actually 31h, for example. So when you calculate 1+1 your are getting 31h+31h=62h which is the ASCII character ‘b’.

To convert your input digits to their equivalent integer values you need to subtract ‘0’ (30h).

Conversely to output integer digits as ASCII characters you will need to add ‘0’.

Leave a Comment