I have a problem when adding 2 numbers in assembly because we are using hex.
When add 4+5 (34h + 35h) the output is 9 but if I add 5+5 (35h + 35h) the output displays colon(:) or 3ah instead of 10.
Here's the sample image when i generate the code.
[IMG]http://i42.tinypic.com/35hpkhs.jpg[/IMG]
Here's my code.
Run>debug
5+4 = 9
a100 ;assemble
mov ah,02
mov ch,35 ;5
mov cl,35
add cl,ch ;5+5
sub cl,30 ;-30
mov dl,cl
int 21
int 20
g
Adding 5 + 5 = :
-a100
mov ah,02
mov ch,34 ;4
mov cl,35
add cl,ch
sub cl,30
mov dl,cl
int 21
int 20
-g
Thanks in advance for your reply.