flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
The problem is that you have to "touch" then stack at runtime else you will get access exception. See this thread for more information.
|
|||
![]() |
|
Azu
It fails to compile or it fails to run?
|
|||
![]() |
|
shoorick
it fails to compile, but who declares initialized data in local variables?
|
|||
![]() |
|
Azu
I think touching will only help for running.. try changing 0 to ? to help it compile..
|
|||
![]() |
|
nazha
it fails to compile, even add following lines to proc32.inc:
repeat localbytes shr 12 mov byte[esp-%*4096],0 end repeat yes, after change to rd 51200, it can be compiled. above three lines help to run. tks. |
|||
![]() |
|
Borsuc
Can you do it manually, without using macros, does it still not compile? I guess not right? (I don't use the macros anyway)
|
|||
![]() |
|
Tomasz Grysztar
It doesn't really hang, it just enters a really long loop of virtual-load directives to generate MOV instructions that initialize the local variables for you. You really shouldn't use initialized locals that big - it generates 12800 MOV instructions (and for each one it virtualizes the whole block - really an overkill, but it's because of the limitations of "load"/"store" directives in fasm 1.x architecture). On my system it took 128 seconds to assemble and generated 500 KB executable.
|
|||
![]() |
|
Azu
![]() Why does it need 500,000 bytes to make 12,800 movs? Is each mov 39 bytes long? |
|||
![]() |
|
Fanael
Because there are 51,200 MOVs. 9.77 byte per MOV, so it's possible (there are many MOVs with DWORD displacement and immediate - 8 bytes, and we must remember that there are two bytes more per MOV - one for opcode and one for mod r/m, so, the size of most MOVs is 10 bytes).
|
|||
![]() |
|
Tomasz Grysztar
Yes, there are 51200 MOVs, my mistake, I thought it was "db" there, but it was "dd".
|
|||
![]() |
|
Azu
Why not use dword movs for dd?
|
|||
![]() |
|
LocoDelAssembly
Quote:
They are dword movs already. |
|||
![]() |
|
Azu
Oops x_x my math was all wrong. Sorry.
|
|||
![]() |
|
r22
Interesting corner-case flaw, this thread should probably be in Macro or Compiler Internals forum.
The compiler would need extra logic to figure out whether it should generate the MOVs inline or use the REP loop if the number before the DUP is too large, or just use a REP prefix loop all the time. |
|||
![]() |
|
Borsuc
It's not the compiler here, it's the macros.
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.