nasm/test/exitrep.asm
H. Peter Anvin (Intel) 5b7369d7e0 Make debug info and error messages correctly reflect macros and reps
1. Error messages would issue with the line number of %endrep.
2. Debug line information would ignore both macros and reps.
   This is doubly wrong; macros are semantically equivalent to
   inline functions, and it is expected that debuggers trace
   into these functions.

These changes finishes the last parts of moving all responsibility for
the listing enable/disable into the preprocessor, so remove the
way over-complicated macro inhibit facility from the listing module
entirely.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-05 02:16:13 -07:00

40 lines
580 B
NASM

%macro testrep 0-1
%assign i 1
%rep %1 4
mov eax,i
%if i==3
%exitrep
%endif
mov ebx,i
%warning in %?%1 iteration i
%if i >= 3
%error iteration i should not be seen
%endif
%assign i i+1
%endrep
ret
%endmacro
%macro testrep_nl 0-1.nolist
%assign i 1
%rep %1 4
mov eax,i
%if i==3
%exitrep
%endif
%warning in %?%1 iteration i
mov ebx,i
%if i >= 3
%error iteration i should not be seen
%endif
%assign i i+1
%endrep
ret
%endmacro
testrep
testrep .nolist
testrep_nl
testrep_nl .nolist