Hello
I was a very long time not here and coing in the last time again with assembly.
Can any tell me how i can change this in If else statement
mov esi,[String]
@@:
mov al,[esi]
inc esi
test al,al
jz @F
jnz @B
@@:
I know it a little code, myquestion is only how it in if else statment
I have a long time not coding in asm asm ::)
Thanks
Quote from: remus2k on May 15, 2010, 08:01:41 AM
Hello
I was a very long time not here and coing in the last time again with assembly.
Can any tell me how i can change this in If else statement
mov esi,[String]
@@:
mov al,[esi]
inc esi
test al,al
jz @F
jnz @B
@@:
I know it a little code, myquestion is only how it in if else statment
I have a long time not coding in asm asm ::)
Thanks
You can use the Zero? operator:
mov esi,[String]
.Repeat
mov al, [esi]
inc esi
test al, al
.Until Zero?
Thanks for your fast reply
And by "test al,al" If this "if al != 0 goto @Out" ?
Then can could write so?
mov esi,[String]
mov al, [esi]
inc esi
;test al, al
.if al != 0
jmp @Out
.endif
Or is this not correct?
You could integrate the test al, al like this:
mov esi,[String]
.Repeat
mov al, [esi]
inc esi
.Until !al
remus2k,
If you want to keep the code simple you can use the .IF form,
.if al == 0
jmp outlabel
.endif
You can do it better though.
test al, al
jnz earlier_label
To do it better again, try this.
movzx eax, BYTE PTR [esi] ; zero extend byte in ESI into EAX
test eax, eax
jnz earlier_label
Ok now have i this understand
Thanks :U