Code:
Code: Select all
;PB x64 v.5.62
Procedure.i TestFnc()
Static Address.i
!mov qword[p.v_Address],123;<- does not work for 'Static' !
Debug Address
EndProcedure
TestFnc()
Code: Select all
;PB x64 v.5.62
Procedure.i TestFnc()
Static Address.i
!mov qword[p.v_Address],123;<- does not work for 'Static' !
Debug Address
EndProcedure
TestFnc()
ThanksFred wrote:If you want to look that, the best is to generate the assembly code with the commandline compiler (--commented switch) and look how it is named. You will save a lot of time when using inline ASM.
Code: Select all
;-> so_PROCEDURENAME.v_VARIABLE
Code: Select all
...
xor rax,rax
add rsp,28
ret
Code: Select all
...
jmp @f
xor rax,rax
@@:
add rsp,28
ret
You could do it like thisMijikai wrote:How can i change the content of 'Address' with inline assembly?
Code: Select all
;PB x64 v.5.62
Procedure.i TestFnc()
Static Address.i
Protected *Address = @Address
!mov rdx, [p.p_Address]
!mov qword [rdx],123
Debug Address
EndProcedure
TestFnc()
Thanks, i didnt think of that waywilbert wrote:...It does produce a bit of additional code and therefore is slightly slower but it does have the advantage that the reference to *Address (local variable) stays the same.Code: Select all
;PB x64 v.5.62 Procedure.i TestFnc() Static Address.i Protected *Address = @Address !mov rdx, [p.p_Address] !mov qword [rdx],123 Debug Address EndProcedure TestFnc()
The reference to a static value changes when the procedure is included in a module.
Mijikai wrote:...
I found something im curious about:
If we have a Procedure that does not return a value PB does this:However if we return a value it looks like this:Code: Select all
... xor rax,rax add rsp,28 ret
why is the jmp & xor even in there ?Code: Select all
... jmp @f xor rax,rax @@: add rsp,28 ret