You've got a number of problems here, mostly dealing with the difference between an address in memory and the "[contents]" of that address. In several instances, you're operating on the address, not the numbers you've entered....
section .data
msg1: db 'Please Enter A Number: ', 10
length1: equ $ - msg1
msg2: db 'Please Enter A Second Number: ', 10
length2: equ $ - msg2
zero: db '0', 0
final: db 'Now adding the two operands...', 10
length3: equ $ - final
msg3: db 'The answer is: ', 0
length4: equ $ - msg3
section .bss
operand1: resb 255
operand2: resb 255
io: resb 255
io2: resb 255
answer: resb 255
sanswer: resb 255
section .text
global _start
_start:
; Print first message
mov eax, 4
mov ebx, 1
mov ecx, msg1
mov edx, length1
int 80h
; Now read value
mov eax, 3
mov ebx, 0
mov ecx, operand1
mov edx, 255
int 80h
; Print second message
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, length2
int 80h
; Now read second value
mov eax, 3
mov ebx, 0
mov ecx, operand2
mov edx, 255
int 80h
; Convert operand1 to integer
mov ebx, operand1
; you're loading the address of operand1
; you probably want [operand1]
sub ebx, 48
mov [io], ebx
; Convert operand2 to integer
mov ebx, operand2
; and here
sub ebx, 48
mov [io2], ebx
; Printing final message before giving the answer.
mov eax, 4
mov ebx, 1
mov ecx, final
mov edx, length3
int 80h
; Add operand1 and 2
mov eax, io
; and here
add eax, io2
; and here
mov [answer], eax
; Convert answer to string
mov ebx, answer
mov eax, 10
div ebx
add ebx, zero
mov [sanswer], ebx
; this is completely wrong.
; Print final message stating answer.
mov eax, 4
mov ebx, 1
mov ecx, msg3
mov edx, length4
; int 80h?
mov eax, 4
mov ebx, 1
mov ecx, sanswer
mov edx, 510
; 510???
int 80h
; Exiting
mov eax, 1
mov ebx, 0 ; Returns an exit code of zero which means success.
; int 80h?
You also leave out an "int 80h" in a couple of places. Now... the "div" instruction divides the value in edx:eax by the operand you provide (ebx, in this case). The quotient appears in eax, and the remainder in edx - that's the digit you want to add '0' to. Something more like:
mov eax, [answer]
mov edx, 10
xor edx, edx ; or mov edx, 0
div ebx
add dl, '0' ; or add dl, [zero]
mov [sanswer], dl
...
That'll only do a single digit. Both the string-to-number routines and the number-to-string routine will have to be modified to do multiple digits, but that should get you started. I suspect the actual segfault is caused by the lack of the final "int 80h"...
Best,
Frank