flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
S.T.A.S. 10 Feb 2004, 04:38
Oh, yes.. there is some modifiyed Privalov's "display" macro.
It shows some info when above macro are compiling Code: ;;=========================================================================== ;; extended display macro ;; use: display 'a',b,<c,d> .. ;; 'a'-text, b-text label, c-number, d-radix. ;; %%L fix ,0Dh,0Ah ;; next line %%H fix ,10h> ;; hex number %%D fix ,10> ;; decimal number %%R fix ,'RVA'> ;; offet hex value %%A fix ,'address'> ;; address hex value (based on EXE_IMAGE_BASE) macro __digit num { if num < 10 display '0'+num else display 'A'+num-10 end if } macro __display arg1,arg2 {if ~ arg1 eq ;; fix "2 commas" problem if arg2 eq display arg1 else local ..tmp, ..radix if arg2 eq 'RVA' display 'RVA: ' ..tmp = RVA arg1 ..radix = 10h else if arg2 eq 'address' display 'address: ' ..tmp = RVA arg1 + EXE_IMAGE_BASE ..radix = 10h else ..tmp = arg1 ..radix = arg2 end if virtual at 0 repeat 32 if ..tmp > 0 db ..tmp mod ..radix ..tmp = ..tmp / ..radix end if end repeat repeat $ load ..tmp byte from $-% __digit ..tmp end repeat if $ = 0 display '0' end if end virtual if ..radix = 10h display 'h' end if end if end if } macro display [arg] { __display arg } ;;=========================================================================== |
|||
![]() |
|
JohnFound 10 Feb 2004, 05:11
Hi S.T.A.S.
What actually is the advantage of using so complex approach? I am using standard "library" and "import" macroses from FASM package. They check whether the function is used and insert it in import table only if it is used, so I can simply include all files from include/apia/ directory and stop bothering any longer about imports. Some time ago, I make some extended tests to determine how this approach will slow compilation and I found out that additional compilation time is between 1 and 2 seconds on my office computer - 400MHz PII laptop. So I decide that this is absolutely acceptable time and stop to make future atempts to improve import functions of FASM. Regards |
|||
![]() |
|
S.T.A.S. 10 Feb 2004, 06:23
Hi JohnFound
The "advantage" (if it is so) is - different import mode. Usually, PE is linked to dlls by OS loader, but in this case we have only one proc in import table. Names of all others are in some 'array' and used *after* program starts. This could be useful in some cases. For example in some packers, etc. As a side effect we usually have a bit smaller exe. Also IMHO it's always good to have an alternative. BTW, this will be "so complex approach" with MASM. In FASM it's absolutly real ![]() |
|||
![]() |
|
JohnFound 10 Feb 2004, 06:50
Yea, from this point of view I am absolutely agree.
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.