flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > fasm as DLL Goto page Previous 1, 2, 3, 4, 5, 6 Next |
Author |
|
Tomasz Grysztar 12 Aug 2019, 19:41
I'm not sure what might have caused this problem in your case, but I have updated the fasmDLL.zip with re-assembled 1.73.16 version. Please check if the new one works for you.
|
|||
12 Aug 2019, 19:41 |
|
DimonSoft 12 Aug 2019, 21:13
My first guess was that you’re trying to compile PREPROCE.INC only (start from this file) which doesn’t contain the symbol. Looked through the file and checked that. Choose FASMX64.ASM tab before compiling or better assign it to compiler from context menu.
|
|||
12 Aug 2019, 21:13 |
|
Abruzzi 09 Jan 2020, 16:02
I used FASM DLL to assembly a simple instruction like xor eax, eax and I wonder why the output_length for this particular instruction is 3 and output binary data is something like 0x6631C0.
I tried to add one more instruction to see how the output is changing and for these two lines Code: xor eax, eax xor eax, eax the output_length is 6 and output binary data is 0x6631C06631C0. What is this extra byte (0x66) used for? |
|||
09 Jan 2020, 16:02 |
|
ProMiNick 09 Jan 2020, 16:48
try this sequence
Code: use16
xor eax, eax thou will see output is the same as thours than try Code: use32
xor eax, eax use16 mode is by default in fasm thou could play with these samples too Code: use16
xor ax, ax Code: use32
xor ax, ax Abruzzi, than I congratulate thou - thou explore bicicle. |
|||
09 Jan 2020, 16:48 |
|
Abruzzi 09 Jan 2020, 17:16
Many thanks ProMiNick. Indeed using use32 directive the output is 2 bytes length and the resulted opcode is 0x31C0 as I expect.
I tried your examples also. Code: use16
xor ax, ax generates 0x31C0 as 32 bit mode if I use eax register and Code: use32
xor ax, ax generates 0x6631C0 as 16 bit mode if I use eax register I have to dig out to understand why it's encoded in that way. Right now it's just witchcraft. |
|||
09 Jan 2020, 17:16 |
|
ProMiNick 09 Jan 2020, 17:33
try to dig out at https://www.youtube.com/channel/UCs_OWSjmFntZqjzSpgJoBhA/featured in decoding instructions
|
|||
09 Jan 2020, 17:33 |
|
Abruzzi 09 Jan 2020, 18:10
It makes sense now why 66h prefix appear before instruction opcode when I am using 32 bit mode and 16 bit operands and vice versa as I could see. Thank you again ProMiNick.
|
|||
09 Jan 2020, 18:10 |
|
soloworker 09 Dec 2020, 01:24
How can we use this assembler to get the relocatable offsets?
Code: mov eax,401000h ;Offset push eax It would be great if it supports the read of these types like for example "Offsets" it writes back the indexes to the offsets. Same for .data section. Any idea how to achieve that? |
|||
09 Dec 2020, 01:24 |
|
revolution 09 Dec 2020, 05:08
If you use PE format and include a relocs table then you will get a fully relocatable exe.
|
|||
09 Dec 2020, 05:08 |
|
soloworker 25 Dec 2020, 02:31
Thx revolution. I have noticed that unrefrenced code is not compiled. Why is this case?
|
|||
25 Dec 2020, 02:31 |
|
revolution 25 Dec 2020, 03:15
If you use the normal fasm proc/endp macros then it has lines like this:
Code: if used function ; in proc macro ;... end if ; in endp macro |
|||
25 Dec 2020, 03:15 |
|
soloworker 25 Dec 2020, 03:46
revolution wrote: If you use the normal fasm proc/endp macros then it has lines like this: You mean the define@proc macro? Quote: macro define@proc name,statement Ok i found it. Thanks for your help. |
|||
25 Dec 2020, 03:46 |
|
soloworker 01 Jan 2021, 08:34
I have a question
Does fasm allocate memory for the same data used in source? Like for example: Code: section '.data' data readable writeable something db 83886080 dup(?) '80MB When assembling, the fasm.exe memory usage goes over 90 MB. Why is this? |
|||
01 Jan 2021, 08:34 |
|
revolution 01 Jan 2021, 08:37
fasm allocates all data and code in RAM. That includes all uninitialised values.
|
|||
01 Jan 2021, 08:37 |
|
Tomasz Grysztar 01 Jan 2021, 11:48
soloworker wrote: I have a question This was improved in case of fasmg's engine - if you assemble the same thing with fasmg, that uninitialized definition is not going to cause any additional memory usage unless you force it to become initialized by putting something initialized after it in the same section. |
|||
01 Jan 2021, 11:48 |
|
soloworker 07 Mar 2021, 05:04
Tomasz Grysztar wrote:
Thanks for the tip. I still don't understand why it uses huge memory (like 400mb) when compiling some relatively small exe under 2mb of size with only this code as data. But the size of the code of (.asm) file is 7mb. So big code with few data will also have this problem. Code: section '.data' data readable writeable sss db 'AXaaaaaaaaaaaaAXaaaaaaaaaaaaAXaaaaaaaaaaaaAXaaaaaaaaaaaa',0 sss2 db 'atatatatatatatatatatatatatatatatatatatatat',0 sss3 db 'tatatatatatatatatatatatatatatatatata',0 sss4 db '53535535355353553535535355353553535535355353553535535355353553535535355353553535535355353553535',0 |
|||
07 Mar 2021, 05:04 |
|
soloworker 09 Mar 2021, 23:42
I found why it uses huge memory.
The macro that is responsible for this is Code: allow_nesting If i remove it, fasm.exe uses way less memory. What does it do? |
|||
09 Mar 2021, 23:42 |
|
bitRAKE 10 Mar 2021, 03:16
iirc, allow_nesting enables using invoke as parameter to another invoke.
Code: invoke CommandLineToArgvW, <invoke GetCommandlineW>,ADDR nargs _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
10 Mar 2021, 03:16 |
|
Ben321 06 Dec 2023, 11:44
Tomasz Grysztar wrote: The subject says all. I found a bug in the FASM DLL. Not sure if this also impacts the normal EXE version, but I found it certainly impacts the DLL version. To tell it that a number is hexadecimal, you can either prepend "0x" or append "h" to the number. I found this doesn't work though if the first digit of the number is a hexadecimal letter. For example, 0xF00000 works, but F00000h generates an error. It's fine if the letter is elsewhere in the hex number. This means a temporary work around hers is to prepend a zero before the first letter, like 0F00000h will work. But it's not ideal. I hope this is a bug that you can fix. |
|||
06 Dec 2023, 11:44 |
|
Goto page Previous 1, 2, 3, 4, 5, 6 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.