I am at the end of writing an assembly program and the trouble area is my compare instruction, it doesn't seem to be working and nothing I do seems to make it work so ALL input being read in is being sent to rejected
code:
loop_top:
input string,40 ; read ASCII characters
atod string ; convert to integer
mov number1, eax ; store in memory
jz done
cmp number1, 50 ; number1>50?
jg rejected
cmp number1, -50 ; number1<-50?
jl rejected
rejected:
dtoa number1ch,eax ; convert to ASCII characters
output number1ch ; print value and message to screen
output reject
jmp loop_top
mov eax, number1 ; store in register
cmp eax,0 ; eax > 0?
jnl isPositive
Problem area ? :
cmp number1, 50 ; number1>50?
jg rejected
cmp number1, -50 ; number1<-50?
jl rejected
rejected:
dtoa number1ch,eax ; convert to ASCII characters
output number1ch ; print value and message to screen
output reject
jmp loop_top
So any number ex: 4, 50, 51, -3, -50, -51 .. are all being sent to rejected. Can someone explain to me why? Thanks!