News:

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

Test eax,eax

Started by Farabi, August 05, 2008, 09:25:46 AM

Previous topic - Next topic

jj2007

Quote from: raymond on August 08, 2008, 03:41:58 PM
I've been caught a few times with algos returning garbage when data was left temporarily in FPU registers while caling MessageBox to alert the user. You can check that out with Ollydebug and watch what is happening with the FPU registers after calling the function.
This is what I did, and it surely affected FPU registers. MMX were changed if emms was not used, but in my limited number of tests I could not observe changes to mmx registers when displaying a message box and emms was used on exit proc. As we all know, FPU and MMX registers are physically the same, but emms might trigger something that saves future mmx content. Just guessing, sorry... I would still like to find some hard evidence from Microsoft & Co.

hutch--

I have seen the effect before with a particular compiler I use from time to time and it has the ugly workaround of resetting the fp stack after every API call because it internally uses fp fr integer maths. It is a mistake for an OS to act in an unpredictable manner but in the cae of Mark's register usage the solution is simple, don't mix API code with code that uses FP registers. In the examples I have seen from Mark over time he uses this method within algorithms where there is no API code so its a perfectly reasonable technique in that context.

You hardly need to save ESP into an MMX register for a MessageBoxA call and this is the case with most API calls.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Mark Jones

Quote from: hutch-- on August 09, 2008, 01:58:41 AM
It is a mistake for an OS to act in an unpredictable manner...

Oh crud, you mean we need to start safeguarding our applications against windows?  :lol
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hutch--

 :bg

Whaddya mean "start" ?  :bdg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Quote from: hutch-- on August 09, 2008, 03:15:33 PM
Whaddya mean "start" ?  :bdg
:cheekygreen:

P.S. Forum is back to normal speed, script kiddie has left..

Mark_Larson

Quote from: hutch-- on August 09, 2008, 01:58:41 AM
I have seen the effect before with a particular compiler I use from time to time and it has the ugly workaround of resetting the fp stack after every API call because it internally uses fp fr integer maths. It is a mistake for an OS to act in an unpredictable manner but in the cae of Mark's register usage the solution is simple, don't mix API code with code that uses FP registers. In the examples I have seen from Mark over time he uses this method within algorithms where there is no API code so its a perfectly reasonable technique in that context.

You hardly need to save ESP into an MMX register for a MessageBoxA call and this is the case with most API calls.

  He is correct a mundo  :bg  And I am tall  :bg

Mark
BIOS programmers do it fastest, hehe.  ;)

My Optimization webpage
htttp://www.website.masmforum.com/mark/index.htm

PBrennick

JJ,

Quote
P.S. Forum is back to normal speed, script kiddie has left..

I use a dial-up and have to because of the living arrangement that I have. To make matters worse, it is one of those 'free' type accounts, so when the forum bogs down I usually get tossed more frquently than a frizzbee. I sure wish something could be done about clowns of that nature. They give jerks a bad name.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

 :bg

Paul,

> I usually get tossed more frquently than a frizzbee.

This would truly be interesting, I have fallen off ladders, motorbikes, pushbikes and landed anywhere from head to toe but I have never done a "frisby" yet, that would be a new experience.  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

NightWare

Quote from: hutch-- on August 09, 2008, 11:16:25 PM
a "frisby" yet, that would be a new experience.  :P
never turned around your computer to see what's wrong ?  :lol

PBrennick

If a website is being bogged down by idiots, why in the world would I have to turn my computer around? Or am I missing something, landing on my head a lot may be having an effect.

BTW: we are witnessing 'the evolution of a topic.'

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

 :bg

> never turned around your computer to see what's wrong ?

I was falling off things long before computes.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

Besides, back then, it was a slipstick (never liked an abacus).  :bg

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

NightWare

Quote from: PBrennick on August 10, 2008, 03:21:24 AM
If a website is being bogged down by idiots, why in the world would I have to turn my computer around? Or am I missing something, landing on my head a lot may be having an effect.
maybe because it's the first thing i do !  :lol

PBrennick

NightWare,
This is interesting. Tell me, if you turn your computer around, does the website load faster? I just tried it and for some unfortunate reason, I am not having the same success as you.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

NightWare

Quote from: PBrennick on August 10, 2008, 10:12:31 PM
This is interesting. Tell me, if you turn your computer around, does the website load faster? I just tried it and for some unfortunate reason, I am not having the same success as you.
then you have a better (rtc) connection than mine, recent computer but old cables...  :lol