came across this bit of code:
section .data
contextbegin:
_fetch dd 0
_readbyte dd 0
_readword dd 0
contextend:
section .text
%rep ((contextend-contextbegin) / 8)
mov eax,[contextbegin]
%endrep
yasm aborts with:
test.asm:8: cannot reference symbol `contextend' in preprocessor
test.asm:8: cannot reference symbol `contextbegin' in preprocessor
which i would understand if we were trying to utilize the value of the symbol directly ... but here we're using unknown values with a known difference. so while the address of contextend and contextbegin may not be known at preproccessing time, the difference in their addresses is known.