So I have this declaration in .bss
answer resb 1
In answer, I store the results of the sum of 2 digit integers ranging from -99 to +99. When I try adding +99 and +99, the answer becomes negative. Any answer within the -128 to 127 range are inputted correctly. How do I resolve this overflow/underflow issue?
I am just beginning in Assembly coding so help me understand this issue. I've tried making resb as resw but my code just produced an "floating point error" when ran so I reverted to using resb.
How i print the answer
;ansh,anso,anst are all declared as resb 1 in .bss
print_answer: ;tens1 holds the answer always
;getting each digit of tens2 to be converted as char
mov al,[answer]
mov bl,100
div bl
mov [ansh],al ; holds tens digit of average
mov [anst],ah
mov ah,0
mov al,[anst]
mov bl,10
div bl
mov [anst],al
mov [anso],ah
add byte[ansh],30h
add byte[anst],30h
add byte[anso],30h
;printing routine follows here