xsaco07 / Frogger-Uefi-Boot

Game Frogger implemented in assembly x86 for UEFI boot.
1 stars 0 forks source link

won't work if stack is 64-bit #2

Open andreiw opened 1 year ago

andreiw commented 1 year ago

https://github.com/xsaco07/Frogger-Uefi-Boot/blob/b4b89adf227be1cb9565bd0750732ed7e246053f/uefi.inc#L349

Just FYI, but ANDing ESP you are setting the high bits of RSP to 0. If RSP was above 4GiB, then this is going to randomly corrupt things.

andreiw commented 1 year ago
-               and                       esp, 0FFFFFFF0h
+               and                       rsp, 0ffffffffFFFFFFF0h