- priority: 5 --> 1
- status: open --> open-works-for-me
The following code is from version 1.31 of nasm.c:
stdscan_reset();
stdscan_bufptr = value;
tokval.t_type = TOKEN_INVALID;
e = evaluate(stdscan, NULL, &tokval, NULL, pass2, report_error,
NULL);
if (e) {
if (!is_reloc(e))
report_error (pass0==1 ? ERR_NONFATAL : ERR_PANIC,
"cannot use non-relocatable expression as "
"ABSOLUTE address");
else {
abs_seg = reloc_seg(e);
abs_offset = reloc_value(e);
}
} else
if (pass==1) abs_offset = 0x100;/* don't go near zero in case of / */
else report_error (ERR_PANIC, "invalid ABSOLUTE address "
"in pass two");
in_abs_seg = TRUE;
location.segment = NO_SEG;
break;
I see two issues:
1. The abs_offset=0x100 looks bogus.
2. The in_abs_seg=TRUE and location.segment=NO_SEG need to
move into the else clause that handles abs_seg and abs_offset.
Otherwise they are executed even when the directive fails -- which
results in a half-way switched segment.