mirror of
				https://github.com/netwide-assembler/nasm.git
				synced 2025-10-10 00:25:06 -04:00 
			
		
		
		
	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>
		
			
				
	
	
		
			41 lines
		
	
	
		
			580 B
		
	
	
	
		
			NASM
		
	
	
	
	
	
			
		
		
	
	
			41 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
 |