I'm trying to set the values of eax/edx to a structure pointer recieved as a procedure argument but it does not work directly in my case. As I'm very newbie in assembler, I must be doing something wrong.
I have a code like this:
Code: Select all
Procedure GetPosition( *out.sf::Vector2i, *window.sf::Window )
sfWindow_getPosition( *window )
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
!mov [p.p_out],eax
!mov [p.p_out+4],edx
CompilerElse
; TODO
CompilerEndIf
EndProcedure
sf::Vector2i is a simple structure defined in a Module:
Code: Select all
Structure Vector2i
x.l
y.l
EndStructure
Code: Select all
Procedure GetPosition( *out.sf::Vector2i, *window.sf::Window )
Protected vout.sf::Vector2i
sfWindow_getPosition( *window )
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
!mov [p.v_vout],eax
!mov [p.v_vout+4],edx
*out\x = vout\x
*out\y = vout\y
CompilerElse
; TODO
CompilerEndIf
EndProcedure
What should I do to set the value directly to the structure pointer argument, without the need to use a local variable ?