flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 ... 6, 7, 8, 9, 10, 11 Next |
Author |
|
revolution 08 Jun 2009, 16:14
So now you finally understand stdcall? Yes? That is part of stdcall, it cannot support vararg. Okay, now you accept?
|
|||
![]() |
|
Azu 08 Jun 2009, 16:15
Okay read what I write before replying, yes? Well, can you?
Last edited by Azu on 08 Jun 2009, 16:16; edited 1 time in total |
|||
![]() |
|
revolution 08 Jun 2009, 16:16
And to answer 'WHY': because you want it to clean up the stack so of course you have to tell it how many arguments to accept. Do you finally "get it"? Please say yes!
|
|||
![]() |
|
Azu 08 Jun 2009, 16:17
revolution wrote: Ans to answer 'WHY': because you want it to clean up the stack so of course you have to tell it how many arguments to accept. Do you finally "get it"? Please say yes! ![]() Why do you try to reply to what I wrote without first reading it? You are just spamming/trolling now.. ![]() |
|||
![]() |
|
arigity 08 Jun 2009, 16:20
stdcall functions ONLY clean up the number of args it knows it has. if you push more you will screw everything else up, thus the compiler will not compile because it knows that what you put in will cause it to crash.
compilers can only do what you tell it to do. you need to tell it beforehand information about the specific call, this is done in different ways for various HLL's. |
|||
![]() |
|
LocoDelAssembly 08 Jun 2009, 16:21
Quote:
In the text you quoted from me could you tell me where I'm passing the wrong number of arguments? Also, even if I would have said passing wrong number of arguments (also possible to do with any stdcall function so I don't get how this has something to do with the discussion), how comes it will be bad for performance when the right (and the way you see "right", i.e., fmt references all the varargs not allowing to reference less) number of args are passed? |
|||
![]() |
|
Azu 08 Jun 2009, 16:23
arigity wrote: stdcall functions ONLY clean up the number of args it knows it has. if you push more you will screw everything else up, thus the compiler will not compile because it knows that what you put in will cause it to crash. LocoDelAssembly wrote:
I think it is a bad thing though. |
|||
![]() |
|
bitRAKE 08 Jun 2009, 16:27
Borsuc wrote: I agree hybrids are good, but I still don't see why would anyone use cdecl. Also, objects can be constructed on the stack when interfaces are organized in a appropriate manner. At one level, for instance, we are working with interfaces which operate on points (two values on the stack); and then at a higher level we operate on triangles (three points on the stack). Using ENTER/LEAVE provides locals from BP while allowing dynamic construction with SP. This is how the instruction set was designed to be used! Sadly, too few have actually perfected the art of it's use, and HLL programmers are constantly pushing (pun intended) for interfaces which are easy for a compiler to optimize (Intel is to blame here as well, imho). <SARCASM> We don't actually want to employ thinking people, or worse yet have to trust them! </SARCASM> Last edited by bitRAKE on 08 Jun 2009, 16:43; edited 1 time in total |
|||
![]() |
|
Azu 08 Jun 2009, 16:30
bitRAKE wrote:
|
|||
![]() |
|
arigity 08 Jun 2009, 16:31
Azu wrote: Like I explained.. over 10 times already.. it does know how many args are pushed to it, I even posted a proof of concept code proving this. Each time it encounters a %, that is one arg. What is so hard to understand? your not getting it at all, listen, your wrong. your way won't work without major complications. it is a terrible standard to even suggest because it requires radical alterations to already existing code, destroys the usefullness of the stack, and imposes a gajillion restrictions that i cannot even begin to fathom all in the name of putting an end to a single instruction. Azu wrote: Wtf? Did the guy who made it, like, hard code the number of args each win32 function takes and go out of his way to make it fail if you put in a different number? Why??? Aside from killing all vararg, this would also make it impossible to push args for the next function.. see -> Quote: stdcall functions ONLY clean up the number of args it knows it has. if you push more you will screw everything else up, thus the compiler will not compile because it knows that what you put in will cause it to crash. this was directed at that. |
|||
![]() |
|
LocoDelAssembly 08 Jun 2009, 16:33
Quote:
This doesn't happens when fmt reference LESS (LESS, LESS!!!!) arguments than passed. BTW, insisting on the problem of bad number of arguments doesn't prove the method shown in your proof of concept is better, it is clearly less efficient (speed-wise) and it is a nightmare to keep local variables that way. |
|||
![]() |
|
Azu 08 Jun 2009, 16:35
revolution wrote: If you are generating a PE file then you will only see a reduction in size if it passes a page boundary (512B). And your code will fail if you try to access into the next VM page. arigity wrote:
There is only one functions that would be altered.. and none of the "restrictions" anyone has mentioned so far are a problem for that. arigity wrote:
LocoDelAssembly wrote:
![]() P.S. passing more arguments then needed is bad for performance, not good for it. * walks off to bed, grumbling about you all getting talkative right as he's getting ready for an stdcall [Sleep],1000*60*60*8 ![]() Last edited by Azu on 08 Jun 2009, 16:56; edited 1 time in total |
|||
![]() |
|
bitRAKE 08 Jun 2009, 16:56
Azu wrote:
Now, if we are talking about interfacing an existing API then of course that will dictate our options, but it is a completely different thing than actually coding one's own. |
|||
![]() |
|
Azu 08 Jun 2009, 16:58
bitRAKE wrote:
|
|||
![]() |
|
arigity 08 Jun 2009, 16:58
Azu wrote: There is only one functions that would be altered.. and none of the "restrictions" anyone has mentioned so far are a problem for that. any function using your standard would need to be radically altered, and (aside from your function killing the usefullness of the stack) all three ones i pointed out will be a problem for any non-trivial function that uses it. (having to read in same order pushed, having to always read every arg, and only being to read it once) ironically, your calling standard might only be useful for a handful of functions which is why you were complaining about cdecl at the start... Azu wrote: *walks off to bed, grumbling about you all waking up right as he's getting ready for an stdcall [Sleep],28'800'000* good night. |
|||
![]() |
|
Azu 08 Jun 2009, 17:02
arigity wrote:
arigity wrote:
|
|||
![]() |
|
LocoDelAssembly 08 Jun 2009, 17:02
Quote:
In my first example is probably better than branching which has serious performance hit when a branch misprediction occurs. However, are you trying to make me believe that because of this thing of passing more parameters is not optimal then your stdcall will be better in the mayority of the varargs cases? I'm still waiting of a single case your idea will be better but yet none, you only show how simple is call with your customized stdcall, but completely hiding the real speed costs. BTW, you PoC simply crash always. |
|||
![]() |
|
Azu 08 Jun 2009, 17:09
LocoDelAssembly wrote:
You are already making a branch, just put the arg in that, problem solved. Now lemme sleep :< LocoDelAssembly wrote: BTW, you PoC simply crash always. ![]() |
|||
![]() |
|
revolution 08 Jun 2009, 17:09
Azu wrote:
|
|||
![]() |
|
Goto page Previous 1, 2, 3 ... 6, 7, 8, 9, 10, 11 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.