Your BUG and bad error message from FASM. There is no 16-bit ELF, only 32-bit and 64-bit

But this doesn't prevent me from having 16-bit code in the file, maybe I want a 32-bit program to write another, 16-bit one, to a disk? In this case, using 16-bit code is perfectly legitimate, so it's a bug in FASM.

Neither allowing 16-bit code inside ELF object is a bug (as you may want to have 16-bit code inside 32-bit file, as Fanael wrote), and neither is an error signalized when it is not possible to generate relocation to 32-bit address for a 16-bit instruction, which can contain only 16-bit one (and that's why you get the "address sizes do not agree" message).

"cx" is not one of registers that can be used for addressing in 16-bit mode. This strange message comes from the fact that after not finding any addressing register of that name, fasm tries to use it as a label name, but fails because it is a reserved word - it is like if you tried to assemble "mov [mov],ax" for example.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum