This code works as intended:
section .bss
var2: DB ?
X: DW ? ; works
With the reservations in opposite order, the code doesn't assemble:
section .bss
X: DW ?
var2: DB ? ; error with lines in other order
I got this error, even though I don't use this label, var2 on another part of the program (in fact, this is reproducible assembling just that code block as a 3-line file).
error: label `var2' changed during code generation [-w+error=label-redef-late]
I think the var2 variable is overwritten by the X variable because it's a word, on 2 bytes.
I am using NASM, version 2.15.04 to assemble this code (also reproducible with 2.15.05).