Basically I have a buffer that contains 3 numbers and I want to see if the numbers = 231. That's all.
I know, I am making this more difficult on myself, but this is the only way I knew how. Can anyone simplify my code?
;-------------------
; Check the sequence
;--------------------
lea edx, TheSequence
mov al, [edx]
.if al != '2'
mov correct_SEQUENCE, 1
ret
.endif
inc edx
mov al, [edx]
.if al != '3'
mov correct_SEQUENCE, 1
ret
.endif
inc edx
mov al, [edx]
.if al != '1'
mov correct_SEQUENCE, 1
ret
.endif
I think the following code'll work.
mov eax, [edx]
and eax, 0FFFFFFh
cmp eax, "231"
Mirno
Due to MASM's tricky syntax it should be:
mov eax, [edx]
and eax, 0FFFFFFh
cmp eax, "132"
Or to make it clearer, this will work on almost every assembler:
mov eax, [edx]
and eax, 0FFFFFFh
cmp eax, 00313332h ; ASCII "231"
cool thanks! I will replace it now!