News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

"Quick" call macros and example

Started by hutch--, June 30, 2005, 12:54:06 PM

Previous topic - Next topic

hutch--

I don't know how useful this is but it appears to be reliable. Instead of push call syntax, it writes the arguments directly to the stack with MOV, corrects the stack then calls the procedure. It produces larger code than using PUSH when the arg is a memory operand but with no pushes through the code in the example, its probably faser in some contexts.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

AeroASM

Three things:

1. Does it handle LOCAL variables?
2. Does it generate a warning when it overwrites eax?
3. CAn you make it so instead of writing to eax every time it uses another one like ecx or edx if eax is being used?

hutch--

#2
Aero,

Locals work like normal, there is a seperate macro for stack variables which are written sequentially so one return of eax does not overwrite the next. Using another register just shifts the problem somewhere else where EAX is by convention transient. It will still have the problem of trying to use EAX directly but invoke does not do this any better.

The idea was to produce a different form of code that was PUSH free as MOV is usually faster particularly when it is called sequentially. When I get in front I will write up a benchmark to test the idea out. At least it seems to work at the moment with no real problems.

LATER :

Sad to say I benchmarked the technique and its about 10% slower than the normal invoke so while it was an interesting idea, there is no speed gain by using it. (shrug etc ...).
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php