Ticket #126 (new defect)

Opened 9 months ago

Last modified 9 months ago

unable to use differences in labels in preprocessor code

Reported by: anonymous Assigned to:
Priority: P1 Milestone:
Component: Preprocessor: NASM-compatible Version: 0.6.0
Severity: normal Keywords:
Cc:

Description

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.

Attachments

Change History

12/03/07 20:51:29 changed by peter

Actually, their difference in addresses is not known at preprocessing time either, at least currently. Unlike NASM, Yasm is a single-pass assembler; it only reads the source file once. We're working on improving Yasm to handle the simpler cases of this, but Yasm will essentially always be somewhat more limited than NASM in this area. I'll leave this ticket open for now reflecting the need for improvement.


Add/Change #126 (unable to use differences in labels in preprocessor code)