Masm 16bit converting Ascii to byte <p>I'm a beginner in assembly language and I have to find a solution fast.<br> The thing is I have to read a number from the person (3 digits), convert it to an integer and compare it to two values.<br> The problem is that after converting the comparisons are off, sometimes the result is correct sometimes it's not.</p> <pre><code>pile segment para stack 'pile' db 256 dup (0) pile ends data segment ageper db 4,5 dup(0) bigg db 13,10,"bigger than 146 ",13,10,"$" lesss db 13,10,"less than 0 ",13,10,"$" right db 13,10,"correct number 123 ",13,10,"$" theint db 0 exacnumber db 123 data ends code segment main proc far assume cs:code assume ds:data assume ss:pile mov ax,data mov ds,ax mov ah,0ah lea dx,ageper int 21h mov ch,0 cmp ageper[4],0 jz phase2 mov ah,ageper[4] sub ah,48 add theint,ah phase2: mov cl,10 cmp ageper[3],0 jz phase3 mov ah,ageper[3] sub ah,48 mov al,ah mul cl add theint,al phase3: mov cl,100 cmp ageper[2],0 jz phase4 mov ah,ageper[2] sub ah,48 mov al,ah mul cl add theint,al phase4: cmp theint,123 je yes cmp theint,130 jg big cmp theint,0 jl less jmp ending big: mov ah,09h lea dx,bigg int 21h jmp ending yes: mov ah,09h lea dx,right int 21h jmp ending less: mov ah,09h lea dx,lesss int 21h ending: mov ageper,20 mov ageper[1],20 mov ah,02 lea dx,theint int 21h mov ah,4ch int 21h main endp code ends end main </code></pre>