NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: gammac on November 25, 2014, 04:43:01 PM

Title: %exitrep - bug or guaranteed feature?
Post by: gammac on November 25, 2014, 04:43:01 PM
Is this behaviour a guaranteed feature?

Code: [Select]
%rep 999
%exitrep
%warning %exitrep don't exits immediately
%endrep
Title: Re: %exitrep - bug or guaranteed feature?
Post by: Rob Neff on November 25, 2014, 04:48:42 PM
What nasm versions have you tested this against?
I know that this "feature" existed in older versions since I had to code around it.
I never re-checked to see if it was resolved in the latest release.
Title: Re: %exitrep - bug or guaranteed feature?
Post by: gammac on November 25, 2014, 04:54:52 PM
The newest version for windows.

>nasm -v
NASM version 2.11.06 compiled on Oct 20 2014
Title: Re: %exitrep - bug or guaranteed feature?
Post by: Rob Neff on November 26, 2014, 07:18:33 PM
hmmm.. guess not.
What I had to do to work around the issue was:
Code: [Select]
%assign %%count 999
%rep %%count
    %if %%count < 990
%exitrep
    %else
        do stuff
    %endif
    %assign %%count %%count - 1
%endrep

Not elegant but works.  Perhaps we can get a nasm dev to comment regarding this "feature".

edit: here is another post (http://forum.nasm.us/index.php?topic=1567.0) regarding the issue.

Title: Re: %exitrep - bug or guaranteed feature?
Post by: gammac on November 27, 2014, 12:27:32 PM
Hi Rob,

thanks but I would put the increment %assign into the %else block.

That post is nearly 2 years old and the bug ist still there. It seems to be a feature. ;)