flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ProMiNick 30 Sep 2018, 21:00
Code: start: 30.09.2018 23:53:22,70 source file: C:\Fasm2\SOURCE_G\DLL\fasmg.dll.asm flat assembler version g.ialrk C:\Fasm2\SOURCE_G\DLL\fasmg.dll.asm [39] C:\Fasm2\SOURCE_G\DLL\../assembler.inc [96]: mov edi,characters macro ? [10] macro mov [121] macro dd [13] macro dword [9]: dd v Processed: dd v Error: variable term used where not expected. finish: 30.09.2018 23:53:55,92 invoke altering(from localptr) was succrsfull, but what to do with mov? from error I can see that it caused in mov edi,characters when Code: macro ? line& match {decorator} instruction, line macro ? any& purge ? x86.settings =: x86.settings use decorator instruction restore x86.settings end macro end match outscope line end macro operate on it then should be operated Code: macro mov? dest*,src* match size [mem], ?src mov dest,src else if src relativeto ebp & src - ebp lea dest,[src] else mov dest,src end if end macro Why "macro dd [13] macro dword [9]" is araised
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. Last edited by ProMiNick on 01 Oct 2018, 10:23; edited 2 times in total |
|||||||||||
![]() |
|
ProMiNick 01 Oct 2018, 09:21
Thanks. It helps.
Code: match ,{ include 'win32a.inc' include 'localptr.inc' } match -,{ else include 'ABI/WIN/win32a.inc' end match _ equ } format PE large NX DLL entry DllEntryPoint match ,{ } match -,{ else macro mov? dest*,src* match size [mem], ?src mov dest,src else if src relativeto ebp & src - ebp lea dest,[src] else mov dest,src end if end macro end match _ equ } |
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 09:23
Please note that this simple DLL version is now included in the official package and it has had some corrections made later.
|
|||
![]() |
|
ProMiNick 01 Oct 2018, 10:22
When I replaced format on it forward refferencing form i got not enough memory
Forward refferenced format macro is so greedy? updated attachment in 1st post _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 10:32
You can get it to display the actual error by reducing the -R setting:
Code: >fasmg fasmg.dll.asm -r100 flat assembler version g.ialrk fasmg.dll.asm [1]: format PE large NX DLL ;rename binary as 'fasmg.DLL' macro PE [55] Custom error: invalid argument. |
|||
![]() |
|
ProMiNick 01 Oct 2018, 12:56
Tomasz thanks again. I found that in PE macro I missed ":".
Now when I compiled project with -r100 - succes. without - error not enought memory Is it mean somewhere endless recursion? or whatever? |
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 13:02
This means there is an infinite recursion somewhere in the first pass. I'll look into it later.
|
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 13:09
Wait, this is certainly the MOV macro, in the first pass FORMAT does not include instruction set, so MOV ends up recursive. You can correct the issue by enforcing variable status on MOV macro, you can do that by adding
Code: purge mov? |
|||
![]() |
|
ProMiNick 01 Oct 2018, 13:22
Thanks again, such fix reduce compilation time from 39,5 sec to 32,3 and always successfull independent from switch -r.
Could it be placed somewhere else except first line of main source? that solves problem too: Code: macro mov? dest*,src* match size [mem], ?src mov dest,src else if src relativeto ebp & src - ebp lea dest,[src] else mov dest,src end if end macro macro mov? dest*,src* end macro purge mov? (-) time penalty +0.2 sec -vs your variant, (+) but now it could be hidden in includes. |
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 14:51
This kind of problems could be avoided entirely if fasmg required additional syntax to mark macro as allowed to be recursive. It would break backward compatibility, but macro recursion is not frequently used, so it would not be a big problem. I should perhaps reconsider.
|
|||
![]() |
|
Tomasz Grysztar 01 Oct 2018, 19:34
I have tested it and I believe this is the right thing to do, even at the cost of having to update some macro packages. This really solves the problem of inadvertent recursion.
|
|||
![]() |
|
ProMiNick 01 Oct 2018, 23:56
Why colon twiced?
Code: else match =PE? settings, clause:;this is first PE.Settings.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE or IMAGE_FILE_32BIT_MACHINE or IMAGE_FILE_LINE_NUMS_STRIPPED or IMAGE_FILE_LOCAL_SYMS_STRIPPED PE.Settings.DllCharacteristics = 0 local seq define seq settings:;this is second |
|||
![]() |
|
Tomasz Grysztar 02 Oct 2018, 05:47
Oh, I have mixed in the macro part from the other package by mistake. A flaw of a hasty commit, for sure.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.