NO

Author Topic: Replace PUSH / POP  (Read 508 times)

Offline HellOfMice

  • Member
  • *
  • Posts: 227
  • Never be pleased, always improve
Replace PUSH / POP
« on: December 06, 2024, 06:37:05 AM »
Sometimes or allways using PUSH makes crashing the functions
So I replace the PUSH by setting the register into a local variable
or I use the xmm registers like this:
Code: [Select]
@WmGetMinMaxInfos :

                            mov     [r9].MINMAXINFO.ptMinTrackSize.x,256    ; Take care that the window is too minimized
                            mov     [r9].MINMAXINFO.ptMinTrackSize.y,256
                            mov     [r9].MINMAXINFO.ptMaxPosition.x,0
                            mov     [r9].MINMAXINFO.ptMaxPosition.y,0

                            movd    xmm9,r9
                            mov     ecx,SM_CXFULLSCREEN
                            call    GetSystemMetrics
                            movd    r9,xmm9

                            mov     [r9].MINMAXINFO.ptMaxTrackSize.x,eax
                            mov     [r9].MINMAXINFO.ptMaxSize.x,eax

                            movd    xmm9,r9
                            mov     ecx,SM_CYFULLSCREEN
                            call    GetSystemMetrics
                            movd    r9,xmm9

                            mov     [r9].MINMAXINFO.ptMaxSize.y,eax
                            mov     [r9].MINMAXINFO.ptMaxTrackSize.y,eax

                            jmp     @Eoj
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 907
    • http://www.vortex.masmcode.com
Re: Replace PUSH / POP
« Reply #1 on: December 06, 2024, 09:07:13 AM »
Hello,

Quote
Sometimes or allways using PUSH makes crashing the functions

In the world of 32-bit coding, consecutive PUSHs for local storage are welcomed but 64-bit coding is restrictive as the stack alignment is sensitive.
Code it... That's all...

Offline HellOfMice

  • Member
  • *
  • Posts: 227
  • Never be pleased, always improve
Re: Replace PUSH / POP
« Reply #2 on: December 06, 2024, 09:25:07 AM »
Hello Vortex,

You are right.

I suggest to create many discussions/sub-forums about asm64
I have some sources from AMD, and other found every where plus mines.
From Agner Fog and Yours too .

That would make the forum living, maybe Pelle is dead but not his forum

What do you think?

Philippe
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 907
    • http://www.vortex.masmcode.com
Re: Replace PUSH / POP
« Reply #3 on: December 07, 2024, 09:31:43 AM »
Hello Philippe,

Let's wait for the announcement of the forum administration. Maybe, Mr. Pelle will return to the forum.

I think both of us and other coders could continue to contribute this section of the forum. New members interested in assembly language can visit the Assembly discussions subforum.
Code it... That's all...