The MASM Forum

General => The Campus => Topic started by: daydreamer on October 07, 2022, 08:50:36 PM

Title: can i code like this in 64 bit instead?
Post by: daydreamer on October 07, 2022, 08:50:36 PM
64 bit winabi register preservation rules apply to gdi as well?
Is it possible to have a loop with one or more xmm regs hold data and trust gdi calls keep them preserved,so i can use them in a loop?
But in 32bit i need to preserve registers myself before call ?


Title: Re: can i code like this in 64 bit instead?
Post by: hutch-- on October 09, 2022, 12:18:17 AM
They apply to everything. Registers are registers.
Title: Re: can i code like this in 64 bit instead?
Post by: zedd151 on October 12, 2022, 05:16:46 AM
http://masm32.com/board/index.php?topic=783.0 (http://masm32.com/board/index.php?topic=783.0)
Don't know if this might help Magnus but I came across that thread during my wanderings about the forum and remember this one.  :biggrin:
Title: Re: can i code like this in 64 bit instead?
Post by: HSE on October 12, 2022, 10:39:45 AM
Hi daydreamer!

Quote from: daydreamer on October 07, 2022, 08:50:36 PM
Is it possible to have a loop with one or more xmm regs hold data and trust gdi calls keep them preserved,so i can use them in a loop?

In theory, any procedure that follow x64 ABI must preserve xmm6 through xmm15. And GDI must not be an exception.

But that give me the idea  :thumbsup:

Now I added pseudo push/pop of XMM registers:freg_push xmm6
  · · ·
freg_pop xmm6
 

Test is with ML64 (and removing xmm6 preservation  :biggrin:).

Regards, HSE.
Title: Re: can i code like this in 64 bit instead?
Post by: daydreamer on October 12, 2022, 06:48:49 PM
great Hector :thumbsup:
now I understand it better,thanks Zedd,Hutch,Hector