flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > struc macro and label ? |
Author |
|
revolution 21 Jun 2024, 15:44
Maybe this only works for ELF?
Code: format _FORMAT macro foo x { if x relativeto $ display `x,' label',13,10 else if x eqtype 0 display `x,' number',13,10 end if } a: b=0 foo a foo b Code: ~ fasm test.asm -d _FORMAT=pe flat assembler version 1.73.31 (16384 kilobytes memory) a label b label 1 passes, 512 bytes. ~ fasm test.asm -d _FORMAT=elf flat assembler version 1.73.31 (16384 kilobytes memory) a label b number 1 passes, 268 bytes. |
|||
21 Jun 2024, 15:44 |
|
Roman 24 Jun 2024, 09:53
Why in ELF format relativeto correct work, but in PE not?
Bug? |
|||
24 Jun 2024, 09:53 |
|
revolution 24 Jun 2024, 10:21
If the condition is changed to test both options
Code: format _FORMAT macro foo x { if x relativeto $ display `x,' label',13,10 end if if x eqtype 0 display `x,' number',13,10 end if } a: b=0 foo a foo b Code: ~ fasm test.asm -d _FORMAT=pe flat assembler version 1.73.31 (16384 kilobytes memory) a label a number b label b number 1 passes, 512 bytes. ~ fasm test.asm -d _FORMAT=elf flat assembler version 1.73.31 (16384 kilobytes memory) a label a number b number 1 passes, 268 bytes. |
|||
24 Jun 2024, 10:21 |
|
Roman 24 Jun 2024, 11:46
I get in PE:
1.0 label 1.0 number 2 label 2 number e1 label e1 number But its wrong result. |
|||
24 Jun 2024, 11:46 |
|
Roman 24 Jun 2024, 13:18
How work proc macro ?
proc a1 Ret endp I mean apply to name something like .label or .proc or .address ? |
|||
24 Jun 2024, 13:18 |
|
ProMiNick 25 Jun 2024, 09:47
Tomasz, Is fasmcore could be patched this way so any $ symbol would be always threated as relocateble no matter relocateble output format or not?
Roman, in case of PE format add at end: Code: virtual data fixups end data end virtual dd 0,8 (in case of already present fixups section or data my one is not needed) |
|||
25 Jun 2024, 09:47 |
|
revolution 25 Jun 2024, 10:11
Why use virtual?
Is it bad to use it normally? Code: data fixups dd 0,8 end data |
|||
25 Jun 2024, 10:11 |
|
ProMiNick 25 Jun 2024, 12:18
Why use virtual? because virtual block is good place for reloc data in case of unwanted reloc table combined with all goodies of symbol $ unrelated to 0 that reached only in relocatable file formmats.
|
|||
25 Jun 2024, 12:18 |
|
Roman 08 Jul 2024, 14:03
Quote: data fixups https://stackoverflow.com/questions/37829732/how-to-use-the-fixups-attribute-on-a-section |
|||
08 Jul 2024, 14:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.