Instead of only teaching TIMES how to do it, you
really want to teach %REP...%ENDREP how to do it,
since they are more general (and thus powerful).
And you want more than just '%'.
See SF #872331 for %*, %%*, %%%* (i.e. being able
to refer to the current iteration in a %REP, and
the current token/char in a %REPTOK/%REPSTR).
See SF #1241018 for %+0 and %-0 (i.e. being able
to refer to the number of completed and remaining
iterations).
See SF #1365092 for multiple % (i.e. being able to
refer to outer reps).
See SF #1552357 for %REP with base/step arguments.
The code attached to #1842438 implements all of the
above.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=68913
Originator: NO
Settle for this?
%macro byte_counter 1
%assign %%count 0
%rep %1 + 1
db %%count
%assign %%count %%count + 1
%endrep
%endmacro
byte_counter 5
Best,
Frank
Logged In: YES
user_id=804543
Originator: NO
Instead of only teaching TIMES how to do it, you
really want to teach %REP...%ENDREP how to do it,
since they are more general (and thus powerful).
And you want more than just '%'.
See SF #872331 for %*, %%*, %%%* (i.e. being able
to refer to the current iteration in a %REP, and
the current token/char in a %REPTOK/%REPSTR).
See SF #1241018 for %+0 and %-0 (i.e. being able
to refer to the number of completed and remaining
iterations).
See SF #1365092 for multiple % (i.e. being able to
refer to outer reps).
See SF #1552357 for %REP with base/step arguments.
The code attached to #1842438 implements all of the
above.