flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Is it bug? |
Author |
|
CandyMan 18 Nov 2011, 22:01
format ELF
use16 Dest: jnz Dest error: address sizes do not agree |
|||
18 Nov 2011, 22:01 |
|
DOS386 19 Nov 2011, 08:07
Your BUG and bad error message from FASM. There is no 16-bit ELF, only 32-bit and 64-bit It should break already at "use16"
Try also: Code: use16 mov [cx], ax PS: please fix (CandyMan) the subject (I can't edit other people's posts in this subforum) PPSS: probably "use16" should be explicitly prohibited in any format except binary and MZ ... see FORMATS.INC line 686 and fix (Tomasz) this one too |
|||
19 Nov 2011, 08:07 |
|
ouadji 19 Nov 2011, 09:20
How to do this Tomasz ? (where is my error ?) |
|||
19 Nov 2011, 09:20 |
|
DOS386 19 Nov 2011, 09:25
RTFF
|
|||
19 Nov 2011, 09:25 |
|
Tomasz Grysztar 20 Nov 2011, 00:47
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).
Code: format ELF use16; this changes code generation, but not ORG Dest: ; so we still use 32-bit relocatable ORG, and "Dest" address jnz Dest ; needs 32-bit relocation and thus can not be used in such instruction Code: format ELF use16 org 100h ; now we state that this piece of 16-bit code will get loaded at address 100h Dest: jnz Dest ; and it works |
|||
20 Nov 2011, 00:47 |
|
ouadji 20 Nov 2011, 01:06
and about this, i don't understand why it does not compile. where is my error Tomasz ? Thank you. Code: use16 mov [cx],ax ;reserved word used as symbol (??) |
|||
20 Nov 2011, 01:06 |
|
Tomasz Grysztar 20 Nov 2011, 01:14
"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.
|
|||
20 Nov 2011, 01:14 |
|
ouadji 20 Nov 2011, 01:53
Quote: "cx" is not one of registers that can be used for addressing in 16-bit mode. of course! ... on this one, I'm an half-wit. Code: use16 mov [bx],ax |
|||
20 Nov 2011, 01:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.