flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 10 Jul 2011, 00:22
1. Inside match, if "param" has no equ substitution then it is simply the literal string "param" and thus matches the other literal string "param".
2. Because of this line: "local ..arg,current@arg". current@arg is actually defined multiple times in the forward loop, and all are combined into one once we are outside the forward loop and back into the common section. 3. This line: "forward done@local equ" defines done@local as blank. The final part you quoted above is restoring done@local back to whatever the previous value was if none of the other lines above have matched and restored it. |
|||
![]() |
|
yoshimitsu 12 Jul 2011, 00:16
Thank you for replying,
got 1. and 2. now. But you kind of got my third question wrong: I can't figure out this piece of code's purpose inside of the local-macro. For example which parameters do you have to provide to make it match? Or, when does this "var" inside that last match generate valid code? As for the suggested modifications, I myself find them reasonable and therefore would like them being implemented, but it'd suck if I only changed my local copy as I then had to distribute those changes as well when sharing source code |
|||
![]() |
|
revolution 12 Jul 2011, 00:41
If the previous two matches did nothing then the parameter "var" is simply assembled directly and the equate for done@local is released. We can't simply ignore "var", it has to either match one of the two templates or be assemble directly.
|
|||
![]() |
|
yoshimitsu 12 Jul 2011, 00:52
But which input needs var to be assembled directly?
Sorry, I'm a bit slow-witted... |
|||
![]() |
|
revolution 12 Jul 2011, 01:09
Code: proc ... local abc[4]:BYTE ;first match local def:DWORD ;second match local ghi rq 4 ;last match |
|||
![]() |
|
yoshimitsu 12 Jul 2011, 01:50
Ah, so the purpose of evaluating just "var" is to provide 'native' data reservation
I just didn't think of it, thank you very much ![]() |
|||
![]() |
|
revolution 12 Jul 2011, 01:57
yoshimitsu wrote: Ah, so the purpose of evaluating just "var" is to provide 'native' data reservation Code: local ajlghiiergjvh #$%^& 0xghjn |
|||
![]() |
|
yoshimitsu 20 Jul 2011, 11:20
Hey, just wanted to ask yet again about my suggested modifications which were altering proc's epilogue a little and making local's syntax match the one used by parameters in the proc-macro
|
|||
![]() |
|
revolution 20 Jul 2011, 11:54
re you suggested mods:
1: If you really care about wasted cycles then you should be manually writing your own code to suit your specific requirements. Counting cycles, and other performance measurements, are very very tricky and intimately linked to the exact CPU and mobo combination you use. There is no universal way to know whether any particular code sequence is "faster" than any other because there are too many variations of hardware and they all perform differently from each other. The only reliable metric that can be used across all hardware variants is code size. 2: Seems to be a personal preference thing here. You would need to wait for Tomasz to read this and decide if it is to his liking. |
|||
![]() |
|
yoshimitsu 20 Jul 2011, 20:27
1. that's an argument. but on the other hand does 'leave' perform two operations therefore it's kind of questionable if there are many or even any processors which execute it faster than just 'pop ebp'
2. it's not important by any means, though, it'd provide some consistency one could also choose by one's favour wether to use 'x', 'x:dword' or 'x:DWORD', it wouldn't harm existing code as well |
|||
![]() |
|
vid 20 Jul 2011, 23:18
1. Also note downside of increased memory consumption during assembly process, for every procedure. But generally, assuming all my assumptions are correc, I'd support 'pop ebp' too
![]() 2. I don't see a need for consistency between LOCAL and PROC argument. LOCAL also allows array form which proc argument doesn't, etc. |
|||
![]() |
|
yoshimitsu 21 Jul 2011, 09:58
I'd rather say they have the same syntax, but when using local it is a little enhanced
Code: proc test a:dword,b:dword local x:DWORD,y:DWORD mov dword [eax],ebx ret endp Code: proc test a:dword,b:dword local x:dword,y:dword mov dword [eax],ebx ret endp Code: proc test a,b local x:DWORD,y:DWORD ret endp Code: proc test a,b local x,y ret endp I'd say it hinders a consistent syntax |
|||
![]() |
|
yoshimitsu 01 Aug 2011, 02:45
yes/no/maybe? :/
|
|||
![]() |
|
revolution 01 Aug 2011, 03:12
yoshimitsu wrote: yes/no/maybe? :/ |
|||
![]() |
|
yoshimitsu 01 Aug 2011, 05:56
I know it's not important by any means and I don't want to annoy, but I was kinda hoping Tomasz would respond whether he could implement those small changes somewhen
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.