flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 12 Dec 2014, 14:09
I assume you actually want to use LEA instead of MOVSX.
Code: lea eax, [Text] ;and the same for the other movsx |
|||
![]() |
|
rinart73 12 Dec 2014, 14:18
Can you explain the difference, please?
UPD: This isn't works. _memcpy won't change variable Text :/ |
|||
![]() |
|
revolution 12 Dec 2014, 14:28
You are putting the arguments for memcpy in the wrong place. You can use the macro cinvoke to do the work for you.
Code: cinvoke _memcpy,Text,addr Text2,9 |
|||
![]() |
|
rinart73 12 Dec 2014, 14:40
I don't understand. Why ebp is the wrong place? I found it in tutorials.
And I tried to use "push" and proc _memcpy, arg1,arg2,arg3... cinvoke is fast? What is the difference from "invoke" and "call"? |
|||
![]() |
|
revolution 12 Dec 2014, 14:44
Your parameters need to follow ESP not EBP.
invoke is a macro, call is a CPU instruction. cinvoke (ccall convention) and invoke (stdcall convention) only differ in the way the stack is restored when the procedure returns. cinvoke will place the "add esp,12", but invoke won't. This is because of the stdcall and ccall convention differences. |
|||
![]() |
|
rinart73 12 Dec 2014, 14:45
cinvoke _memcpy, Text, addr Text2, 9
Error: invalid value : pushd addr ..var?TK cinvoke _memcpy, Text, dword[Text2], 9 Error: operand size not specified: call[_memcpy] |
|||
![]() |
|
revolution 12 Dec 2014, 14:48
Oh, sorry, your _memcpy is not the MSVCRT version. In that case use "stdcall _memcpy,...".
Also, don't put the ! in front of the names, it has no meaning unless you define your variable names with the ! also. |
|||
![]() |
|
rinart73 12 Dec 2014, 14:53
I use it for reason, believe me
![]() stdcall _memcpy, !Text, dword[!Text2], 9 Result: Crash |
|||
![]() |
|
rinart73 12 Dec 2014, 14:53
I use it for reason, believe me
![]() stdcall _memcpy, Text, dword[Text2], 9 Result: Crash |
|||
![]() |
|
revolution 12 Dec 2014, 15:09
Use "addr" not "dword":
Code: stdcall _memcpy, Text, addr Text2, 9 |
|||
![]() |
|
rinart73 12 Dec 2014, 15:18
all is working
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.