Hi! Basically I'm receiving user input, storing it in a buffer, and then (so far) testing the first of the three digit combination. However, when I CMP the first digit to the first number in the correct serial code it always tell me that I've entered the wrong serial code, even though printing that first digit yields '2'?
Here's the complete code:

org 100h

jmp _start

welcome_msg db "Please enter your serial code: ", "$"
fail_msg db "Wrong serial code!", "$"
success_msg db "Thank you for CRACKING this software!", "$"
serial db 0, 0, 0

    mov ah, 09h
    lea dx, [fail_msg]
    int 21h
    mov ah, 09h
    lea dx, [welcome_msg]
    int 21h
    lea bx, [serial]
    xor ax, ax
    int 16h
    mov ah, 02h
    mov dl, al
    int 21h
    mov [bx], al
    add bx, 1
    cmp al, 13
    jne get_user_input
    mov ah, 02h
    mov dl, 0ah
    int 21h
    cmp byte [serial], 02h
    jne fail
    mov ah, 09h
    lea dx, [success_msg]
    int 21h

And by the way, before you accuse me of anything, check out this thread: http://www.daniweb.com/software-development/assembly/threads/377671
Also (not my number one priority right now) can anyone tell me why it is that when I enter a 3+ digit combination it crashes, and the 16-bit MS-DOS Subsystem informs me that the CPU has encountered an illegal instruction?

5 Years
Discussion Span
Last Post by bd338

Thanks a lot Narue! :) ARRRGHH! How could I forget?! And the crash was just a result of me trying to access serial + 3 and thereby going outside the boundaries of the array.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.