Page 1 of 1

64bit ASM question

Posted: Fri Jul 12, 2013 8:37 am
by eriansa
This is valid in 32Bit :

Code: Select all

!use32
!push edi
But not in 64Bit. Why?

A workaround :

Code: Select all

compilerif SizeOf(Integer)=8
!push rbp
!push rdi
CompilerElse
!push ebp
!push edi
CompilerEndIf
!mov eax,10
compilerif SizeOf(Integer)=8
!pop rdi
!pop rbp
CompilerElse
!pop edi
!pop ebp
CompilerEndIf
MessageRequester("Hallo","Why?")
But the question remains...

Re: 64bit ASM question

Posted: Sat Jul 13, 2013 3:48 pm
by Thorium
Because stack items allways have the native register size. So for 64bit you allways need to push a 64bit value, on 32bit you have to push a 32bit value.