Adding two numbers help

OK...I just need to write a simple program that adds two numbers given user input with a sum of 0 - 9 (sum < 10). I know that after the input of the numbers I need to subtract 0x30 from them the get the actual number, but how would I go about it?? Am I starting it right?? Any help would be appreciated!!

section .bss
char resb 1
section .text
global main
mov eax, 3
mov ebx, 0
mov ecx, char
mov edx, 2
int 0x80

mov cx, [char]
sub cx, 0x30
mov eax, ecx
int 0x80

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!