mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-10-10 00:25:06 -04:00
The late cleanup of macros can cause severe memory hogging with nested %reps. Instead, implement proper reference counting for mmacros. Adds some other minor cleanups as well, notably delete_*() are designed to update or null the pointer that is passed to it. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
57 lines
660 B
NASM
57 lines
660 B
NASM
[bits 64]
|
|
|
|
;
|
|
; HIT: Maximum possible value
|
|
%assign i 0
|
|
%rep 1000000
|
|
mov rax, i
|
|
%assign i i+1
|
|
%if i == 2
|
|
%exitrep
|
|
%endif
|
|
%endrep
|
|
|
|
;
|
|
; MISS: It's negative
|
|
%assign i 0
|
|
%rep 0xffffFFFFffffFFFE
|
|
mov rax, 0xffffFFFFffffFFFE
|
|
%assign i i+1
|
|
%if i == 2
|
|
%exitrep
|
|
%endif
|
|
%endrep
|
|
|
|
;
|
|
; MISS: It's negative
|
|
%assign i 0
|
|
%rep 0xffffFFFFffffFFFF
|
|
db i
|
|
%assign i i+1
|
|
%if i == 2
|
|
%exitrep
|
|
%endif
|
|
%endrep
|
|
|
|
;
|
|
; MISS: It's negative
|
|
%assign i 0
|
|
%rep -2
|
|
db i
|
|
%assign i i+1
|
|
%if i == 2
|
|
%exitrep
|
|
%endif
|
|
%endrep
|
|
|
|
;
|
|
; MISS: It's negative
|
|
%assign i 0
|
|
%rep -1
|
|
db i
|
|
%assign i i+1
|
|
%if i == 2
|
|
%exitrep
|
|
%endif
|
|
%endrep
|