Dumb example, but it explains it best (I hope).
; DUMB_DB.ASM
; doesn't work: NASM 0.98.39 or 2.08.01
; works: YASM 1.0.0
org 100h
begin:
mov cl,10
mov al,[table]
add ax,80h
div cl
push ax
aam
or ax,'00'
xchg ah,al
int 29h
xchg ah,al
int 29h
pop ax
xchg ah,al
or al,'0'
int 29h
ret
;table: db 321-80h ; yet this works in NASM, dunno why
table: db begin-80h ; doesn't work in NASM, dunno why
See also the NASM manual section 12.1.4 ( http://nasm.us/doc/nasmdo12.html#section-12.1#section-12.1.4 ). Using (begin-$$) kind of solves this problem, but is maybe not ideal.
This is a feature request, not a bug, per se.
What this means is adding internal support for 8-bit wide relocatable data types i.e. REL1ADR.
We also really could use better documentation explaining to user than -f bin really is nothing but a linker built into the nasm binary. Not that anyone will actually understand and/or read that documentation...