Message board for the users of flat assembler.
> Main > Jump Above or Equal, or Jump Carry Clear.
SoLo2 26 Aug 2007, 05:32
I am using 1 Byte in AL to
count from 244 to 0 included.
This means that I have to check
for zero or above to repeat
the loop, or carry clear, as I
think that carry would happen
when turning from 0 to -1 (255),
Well... I tried a little routine like
this in fasm, but it never ends:
FYI, this is supposed to clear
registers of the FM synth of
(which I don't manage too sound)
|26 Aug 2007, 05:32||
ManOfSteel 26 Aug 2007, 06:19
1. carry jump is 'jc' or 'jnc' not 'jcc'.
2. dec doesn't change the carry flag. You should use 'sub reg,1' for that.
3. if you want to use 'dec' use 'jnz'. And don't forget to save 'eax' in 'ClearFMRegister'. Also, keep in mind that j(n)z will jump on zero (0) condition while j(n)c will jump on carry condition (255 / -1), so there's a difference of 1 between the two.
|26 Aug 2007, 06:19||
SoLo2 26 Aug 2007, 07:05
I will be using "sub reg,1" then.
And, of course, it was "jnc" and not "jcc".
|26 Aug 2007, 07:05||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.