Author Topic: %exitrep - bug or guaranteed feature?  (Read 7641 times)

Offline gammac

  • Jr. Member
  • *
  • Posts: 71
  • Country: 00
%exitrep - bug or guaranteed feature?
« 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
Please comment your code! It helps to help you.

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: %exitrep - bug or guaranteed feature?
« Reply #1 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.

Offline gammac

  • Jr. Member
  • *
  • Posts: 71
  • Country: 00
Re: %exitrep - bug or guaranteed feature?
« Reply #2 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
Please comment your code! It helps to help you.

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: %exitrep - bug or guaranteed feature?
« Reply #3 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 regarding the issue.

« Last Edit: November 26, 2014, 07:23:24 PM by Rob Neff »

Offline gammac

  • Jr. Member
  • *
  • Posts: 71
  • Country: 00
Re: %exitrep - bug or guaranteed feature?
« Reply #4 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. ;)

Please comment your code! It helps to help you.