flat assembler
Message board for the users of flat assembler.

Index > Main > cmove error if cmove eax,adr

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1060
Roman
I use fasmw 1.73

I try compile and get error invalid argument:
Code:
in data: Val1 dd 2
cmove r14,Val1
    


I read this and see cmove must get mem addres.
https://www.felixcloutier.com/x86/cmovcc


Last edited by Roman on 16 Apr 2021, 05:42; edited 1 time in total
Post 16 Apr 2021, 05:33
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18074
Location: In your JS exploiting you and your system
revolution
dd is a dword.
r14 is a qword.
Post 16 Apr 2021, 05:36
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1060
Roman
Not work too:
Code:
in data: Val1 dq 2
cmove r14,Val1  ;i get address ! Not value from [Val1]
    


Work only:
Code:
in data: Val1 dd 2

mov rdx,Val1
cmp eax,ebx
cmove r14,rdx    


I found this
https://wiki.cheatengine.org/index.php?title=Assembler:Commands:CMOVE
Post 16 Apr 2021, 05:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18074
Location: In your JS exploiting you and your system
revolution
cmov doesn't have an immediate argument.

Code:
cmovc rax, 0x1234 ; invalid
cmovc rax, [0x1234] ; okay    
Maybe you just forgot the brackets?
Code:
cmove r14, [Val1]    
Post 16 Apr 2021, 05:56
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1060
Roman
I think exist cmove reg, mem address.
And i write cmove r14, address Val1

But why intel not have cmove reg, address mem I not understood.


Last edited by Roman on 16 Apr 2021, 16:22; edited 1 time in total
Post 16 Apr 2021, 06:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18074
Location: In your JS exploiting you and your system
revolution
Roman wrote:
But why intel not have cmove reg, address mem ...
Ask Intel. They decided it.
Post 16 Apr 2021, 06:14
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 937
Location: Belarus
DimonSoft
It’s not “address”, it’s just an immediate with no implied semantics.
Post 16 Apr 2021, 07:30
View user's profile Send private message Visit poster's website Reply with quote
Bytecroc



Joined: 03 May 2021
Posts: 2
Location: Germany
Bytecroc
Hello, I am starting to learn assembly 64bit in this days, year ago I programmed a bit 32bit assebly
so I put together the websides.

I found that for x64 it is not CMOVE instead use CMOVEQ


https://docs.oracle.com/cd/E19120-01/open.solaris/817-5477/6mkuavhs9/index.html#indexterm-88

https://www.doc-developpement-durable.org/file/Projets-informatiques/cours-&-manuels-informatiques/Solaris-sun/Solaris11/x86%20Assembly%20Language%20Reference%20Manual.pdf
Post 21 May 2021, 15:51
View user's profile Send private message Reply with quote
Bytecroc



Joined: 03 May 2021
Posts: 2
Location: Germany
Bytecroc
Sorry I must post again
when I go to Intel

https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf

then cmove reg,mem is valid for x64

did you have assembled with PE64 ?
Post 21 May 2021, 16:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.