are Pseudo HLL directives <---(i do not know if i can call it like that) lives any trash in registers or memory ?
Posted on 2002-11-19 05:29:46 by drakoforma
You mean if/endif etc?
Posted on 2002-11-19 05:49:36 by bazik
Invoke can trash eax (and maybe more), if, ie, it has to use a retrieve the address of a buffer in the stack...

pseudo code:


Invoke MyFunc, ADDR myBuffer

becomes


lea eax, mybuffer
push eax


Invoke is a bit stupid and will miss many optimizations opportunities (it is an assembler, not an HLL compiler, after all).
Sometimes, I dissasemble my owns programs to see what code invoke generated and see if I can simplifiy and optimize the code.

Regards,
Posted on 2002-11-19 08:42:27 by JCP
Yea i mean .IF .WHILE .REPEAT IF etc. etc.
Posted on 2002-11-19 10:19:07 by drakoforma
drakoforma,

Pseudo high level directives are "like" high level language constructions but they translate directly to assembler instructions.

The main advantage of using "invoke" is the error checking against the prototype that it requires so that you catch size and number of parameter errors.

The various loop directives work OK but if you are writing a time critical algorithm, you will generally code them manually as you can produce more efficient code that way.

As a rough distinction, you use the pseudo high level constructions when working with API code but code algorithms manually so that you have the advantage of clarity in the the external code and performance in the local speed critical code.

Regards,

hutch@movsd.com
Posted on 2002-11-19 18:13:30 by hutch--
Is there anyway to have MASM generate an output file showing the exact asm code it generates as it translates HLL code; invoke, if, while, etc.

I know we can disassemble our own programs, but I thought it would be interesting to see the intermediate code masm creates before assembling.

Thanks,

farrier
Posted on 2002-11-20 00:46:11 by farrier
So is it good to make a .code with Pseudo HLL directives and after checking .IF all is well rebuild it to pure assembler ?
Posted on 2002-11-20 06:22:12 by drakoforma
farrier,
Sure. Use the /Sa option for your listing. That produces a BIG listing if you have a lot of INCLUDE files. You can just about predict what the high level control statements will generate. They are clueless about the CMOV instructions. They cannot seem to generate the test and jump instruction sequences like TEST EBX,EBX; JZ SOMEWHERE. They use the OR instruction instead of the better TEST instruction for logical tests. Their biggest advantage is that they make the listing look cleaner, because they hide all the labels needed to implement the control statement jumps. Ratch
Posted on 2002-11-20 14:50:51 by Ratch
Thanks Ratch,

I'll try it.

Maximize Source Listing
I'm not sure I would have connected that with my question! But now it makes sense.

farrier
Posted on 2002-11-20 17:27:31 by farrier