flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Advanced x86 Encoder - operand sizes |
| Author |
|
|
revolution 17 Dec 2025, 03:21
I tried these four variants and had no trouble:
Code: mov [0],cs mov [word 0],cs mov word [0],cs mov word [word 0],cs Code: flat assembler version 1.73.31 (16384 kilobytes memory) 1 passes, 16 bytes. Code: 00000000 8C0E0000 mov [0x0],cs 00000004 8C0E0000 mov [0x0],cs 00000008 8C0E0000 mov [0x0],cs 0000000C 8C0E0000 mov [0x0],cs |
|||
|
|
Tomasz Grysztar 17 Dec 2025, 07:55
There was a bug in fasm2, causing an incompatibility with fasm. I fixed it and now fasm2 gives the same result as the one shown by revolution.
|
|||
|
|
Tomasz Grysztar 17 Dec 2025, 08:10
As for the second problem, it's a common theme of fasm and fasm2: to add additional checks and constraints you usually insert ASSERT or, for more complex ones, write a macro. With fasm2/fasmg you could also tweak the actual encoder parts, but that's a more advanced thing.
See also my old legacy source assembly for examples of customized encoders (in that case, emulating some old DOS assemblers). I have not updated them for fasm2, but one day I might. PS. With fasm2 there is also this option: Code: include 'macro/inline.inc' inlinemacro signed_byte value* assert value >= -80h & value < 80h return = value end inlinemacro add di,signed_byte(0x50) |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.