flat assembler
Message board for the users of flat assembler.
Index
> Main > What is your favourite calling standard? Goto page Previous 1, 2, 3 |
Author |
|
ic2 01 Mar 2008, 16:39
I thought you had posted a link to the latest version of Olly but it was LocoDelAssembly. Doing my short time flying though the site reading everything possible, you and he seems to have the same style.
Anyway, Thanks revolution, 1st lesson learned. There's too many important things to learn about Fasm so I will not be wasting time anti-debugging for quite a while. Back to the manual for me. DEAL ... |
|||
01 Mar 2008, 16:39 |
|
bitRAKE 01 Mar 2008, 16:47
To talk of the external appearance of the interface without how that will be implemented is kind of one-sided. Which really is the whole problem with standards: code itself dictates a minimal interface which is specific to the routine, but standards seek a minimal description of all interfaces.
Sure algorithms can be implemented for any calling convention, but rarely is that the minimal interface needed by the algorithm. So, the question, "What is gained by a standard calling convention?" If we can instantly see what the interface is and know x86 sufficiently - nothing. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
01 Mar 2008, 16:47 |
|
revolution 01 Mar 2008, 16:56
bitRAKE wrote: To talk of the external appearance of the interface without how that will be implemented is kind of one-sided. Which really is the whole problem with standards: code itself dictates a minimal interface which is specific to the routine, but standards seek a minimal description of all interfaces. bitRAKE wrote: Sure algorithms can be implemented for any calling convention, but rarely is that the minimal interface needed by the algorithm. So, the question, "What is gained by a standard calling convention?" If we can instantly see what the interface is and know x86 sufficiently - nothing. * The measurement parameter of severe is, of course, indeterminate and varies for each app. An app that must perform at peak performance over a long period (eg. Prime95) will have a very narrow definitions of severe and acceptable. An app with brief periods of computation and long periods of idle (eg. Acrobat reader) will have very wide definitions of severe and acceptable. |
|||
01 Mar 2008, 16:56 |
|
bitRAKE 01 Mar 2008, 17:33
Ah, so you primarily code to the interfaces.
Sorry, never could do that. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
01 Mar 2008, 17:33 |
|
daniel.lewis 02 Mar 2008, 06:37
Yeah, I don't
Quote: Willy-nilly changing of calling standards within a single app can create more problems than it solves Can you provide an example? I haven't seen such a case yet. As for obfuscating your code, I think it's a shameful activity. We should be trying to *help* people understand the truth, not trying to blind them to it. If your product is just one of 64 products that do the same thing, nobody cares enough to reverse your shit. If it's truly amazing software, an open source version will be made if the guys think it's harder to reverse than rewrite. That'll be more damaging, because the open source version will be accepted by even those people who have moral stipulations with cracked software. Proprietary software exists in four forms in my world: 1) the obscure, rarely used stuff 2) stuff huge corps use, like at my work 3) stuff that's cutting edge, and pulling some cash before it's open sourced. 4) windows. _________________ dd 0x90909090 ; problem solved. |
|||
02 Mar 2008, 06:37 |
|
revolution 02 Mar 2008, 06:50
daniel.lewis wrote:
It is easy to say that a particular coding method is not problematic, but without having a good amount of experience with other coding methods that conclusion is suspect at best. |
|||
02 Mar 2008, 06:50 |
|
bitRAKE 02 Mar 2008, 19:58
So, now the claim is that there is some special experience that makes future experience less valuable. This is not the case. Children today make the same mistakes children have been making for thousands of years - parents are doing it too.
The experience itself gives value to the abstractions. To give people abstractions and say, "value these" - doesn't work. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup Last edited by bitRAKE on 03 Mar 2008, 01:45; edited 1 time in total |
|||
02 Mar 2008, 19:58 |
|
daniel.lewis 03 Mar 2008, 00:29
@Revolution:
While you weren't far off with mentioning ESP as being a GPR, in practice it's not safe to do so simply because certainly nameless operating systems tend to check it to make sure it's inside the stack to prevent buffer overflows. Quote: As you write more and more code you will come to realise some things. Yeah, I've been coding for 12 years when I started writing SGML in 1997. I work as a scripter for the largest company in the world. My aunt has a fellowship in IBM, my mother worked on mainframes in RPG40, and my first PC had nothing but a 5 1/4" floppy drive. Engineering, architecture, math, and recently computer science has been in the family for over 300 years. Quote: The hardest part is to be able to recognise that there is a problem. Most new programmers don't understand that what they are doing is creating problems because they have no experience with a coding style that does not create those problems. I don't see a problem, but then that must be the problem? Woe is me. Just because a methodology confuses you, doesn't mean it's problematic to the rest of the world. I actually revel in it. Quote: But they do all of this without even understanding that other methods may have avoided those little niggling problems before they happened. Could you perhaps be a little more ambiguous? I'm well aware of __cdecl, stdcall, fastcall, pascal etc. etc. I understand them. I could write a cute little book on them but I'm not in the department of redundancy department. Quote:
Take the pepsi challenge. Your use of language, revolution, thusfar definitely isn't causing me to gain respect for you or what you have to say. I also find your efforts to insult my intelligence transparent and base, which would be much more tolerable if you could fork out the evidence. I don't mind being told I'm wrong, as long as I'm told why. You very well may have a good example, but you're evidently failing to make your point. I'm hoping you will. For the last few months, I've been longing for a change in paradigms. _________________ dd 0x90909090 ; problem solved. |
|||
03 Mar 2008, 00:29 |
|
r22 04 Mar 2008, 00:05
re: daniel
Please don't insult us with logical fallacies. 1) Your family history is irrelevant and trying to pass it off as personal experience is laughable. 2) The number of years you've been programming is meaningless. Now referring us to a project you've worked on would be a much better way of touting your experience. There are plenty of programmers that have been in the industry for decades and still write crap/spaghetti code, but those programmers are almost NEVER attached to any significant projects. 3) Saying you work for the largest company in the world as a scripter has zero relevance on your ability to write good assembly. 3.5) The irony of you calling Revolution out on being "ambiguous", while defending your "confuses you"/ambiguous calling convention did not escape me, and I got a chuckle out of it. --------------------------------------- On Topic: If you want to say using a non standard calling convention makes your programs faster/better in any way then you need to back it up. Now if you use it "just because" thats fine too, just don't expect anyone to bother with your source code. When speed is a concern there's only 4 things you need to do: - Optimize the underlying ALGORITHMs - Inline your functions - Unroll loops - Parallelize (SIMD) and multi-thread Inlining negates the need for any calling convention mangling. In most cases, I prefer to use a familiar standard; preferring the one used by the OS that I'm developing for. |
|||
04 Mar 2008, 00:05 |
|
daniel.lewis 04 Mar 2008, 23:47
Off Topic:
1) My family history isn't irrelevant. I was learning things like binary sort at 11 because my aunt explained it to me. Much of what I do is relevant to my having gained sufficient experience. 2) You're right. I could spend years being an assembler programmer and not even be comfortable leaving __cdecl calling convention, or Java Programmer and walk away not even knowing what the "<<" operator does. I'm capable of innovative, creative thought though. 3) Agreed, but the fact that I do does have relevance to my being able to program maintainable, well documented code; my having exposure to other people's source, and my source being reviewed regularly by both programmers and managers alike. 3.5) Flexibility in a calling convention is a "feature". I believe there was someone else who said exactly that in one of the above posts with regards to stack usage. Ambiguously saying Quote:
doesn't make any point. His entire post, in context, is roughly equivalent to saying: "I don't like that. You are poopoo." THAT is the difference. I was asking him to provide some measure of evidence to back up his claim. Not the poopoo one. The one that it creates more problems than it solves. Something which is ON TOPIC, unlike your request for my resume. On Topic: revolution went into calling down my intelligence and experience, but you guys still can't face the issue at hand. What makes: Code: push x push y push z call a a: push ebp mov ebp, esp bla bla bla ginger pop esp pop z pop y pop z ret so much more maintainable that you feel the need to focus on insulting me when I suggest using something leaner and more appropriate? From the on-topic comments I've seen so far, it's simply because you're incapable of reading comments? Straight from my own snippets: Code: ; String_indexOf ; Synopsis: ; return index of start of needle in haystack ; flag ne means no match ; ; Registers: ; ESI = haystack ; EDI = needle ; ECX = haystack.length ; EDX = needle.length ; taints XMM0,XMM1,XMM2,XMM3 String_indexOf: ... Is that so unfathomably difficult? _________________ dd 0x90909090 ; problem solved. |
|||
04 Mar 2008, 23:47 |
|
bitRAKE 05 Mar 2008, 02:51
It might even be arguable that the assumptions of a 'standard' calling convention lead to more delays due to errors than the time saved in assuming. Personally, I've replied to dozens of posts (across the i-hwy) regarding the epilogue/prologue for functions/proceedures. Hope I haven't lead too many astray, lol.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
05 Mar 2008, 02:51 |
|
daniel.lewis 05 Mar 2008, 04:06
daniel.lewis wrote: Is that so unfathomably difficult? Heh... apparently. I forget to mention in my comments that I return the result in EAX. _________________ dd 0x90909090 ; problem solved. |
|||
05 Mar 2008, 04:06 |
|
Tomasz Grysztar 05 Mar 2008, 06:42
daniel.lewis wrote:
It's a bit strange thing you put here instead of LEAVE + RETN 12. Unless the "bla bla bla" does some stack shuffling, it won't work. daniel.lewis wrote: Straight from my own snippets: Yeah, that's the same kind of convention I use (I only I can - that is when I don't have to make the procs callable from some other language) and for the pure assembly code I consider it the best. Except I sometimes even don't put the comments there (see fasm sources) |
|||
05 Mar 2008, 06:42 |
|
daniel.lewis 05 Mar 2008, 07:43
Heh, yeah, I really bungled that one up. I'm pushing before the call, and popping before the ret.
*sigh* must.. sleep.. more.. often. :p |
|||
05 Mar 2008, 07:43 |
|
bitRAKE 05 Mar 2008, 11:55
Windows system call interface is interesting. Basically,
Code: .A: xor eax,eax lodsb pop edx sysenter Code: mov esi,scab call .A dd .B ;-> EIP dd .1 ; top of stack on return dd SystemPerformanceInformation dd spi dd spi.sizeof dd 0 .1: dd .C dd .2 dd -1 dd pAddr dd 0 dd pBytes dd MEM_COMMIT dd PAGE_EXECUTE_READWRITE .2: ... .B: imul ecx,[spi.AvailablePages],4096 mov [pBytes],ecx jmp .A .C: ... scab db NtQuerySystemInformation,NtAllocateVirtualMemory,... _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
05 Mar 2008, 11:55 |
|
daniel.lewis 06 Mar 2008, 07:05
Yeah, Lua and most JavaScript engines make every function include a pointer to the "scope/context". This solves the problem of Global being a constant which prevents you from having more than one running at the same time, but it's just *wrong*
I had thought to simply use [ESP+36] or whatever the case may be to get it from the caller directly, but then that would be dependent on stack depth and painful to calculate through recursion. So now it's dynamically allocated, and I've opted to use ring-queueing to handle active and dormant engine States. Best Regards, Dan |
|||
06 Mar 2008, 07:05 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.