Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Assembly Language 80386

Name: Anonymous 2010-11-20 18:24

ok, so here's my problem:
main:
        mov     eax, prompt0      ; print out prompt
        call    print_string
        call    read_char
       
        cmp             eax, 'a'
        je        near addition
        cmp             eax, 's'
        je         near subtraction
        cmp        eax, 'm'
        je         near multiplication
        cmp             eax, 'd'
        je        near division
        cmp        eax, 'o'
        je         near modulo
        cmp        eax, 'x'
        je        exit
        jmp     main
/code

for some reason when I run my program, it prints that output msg twice.  this is the only part of my program that has:
mov     eax, prompt0      ; print out prompt
call    print_string

So I'm at a loss as to why the hell it would double up on prompt0 the second time through.  anyone have any thoughts on this?

Name: Anonymous 2010-11-22 11:00

>>31

No man I like my registers with a little meat on them ;-), just saying that al is the perfect size for a single ASCII character so that cmp al, 'a' might be a more apt comparison.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List