PureBasic Forum
http://forums.purebasic.com/english/

64bit ASM question
http://forums.purebasic.com/english/viewtopic.php?f=35&t=55413
Page 1 of 1

Author:  eriansa [ Fri Jul 12, 2013 8:37 am ]
Post subject:  64bit ASM question

This is valid in 32Bit :

Code:
!use32
!push edi


But not in 64Bit. Why?

A workaround :

Code:
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...

Author:  Thorium [ Sat Jul 13, 2013 3:48 pm ]
Post subject:  Re: 64bit ASM question

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/