flat assembler
Message board for the users of flat assembler.

Index > Main > whats the opcode difference?

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
[see image]
When/why compiler will choose FF/0 instead 40+rd if using a register?


Description:
Filesize: 40 KB
Viewed: 2416 Time(s)

imagem.png



_________________
Sorry if bad english.
Post 09 Jul 2010, 13:34
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
in long mode 40+ is REX prefix, only way to encode inc/dec is by modrm opcode.
Post 09 Jul 2010, 14:21
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 692
Location: Adelaide
sinsi
In long mode lots of opcodes referring to the high 8-bit registers are prefix bytes to use r8-r15.

>in long mode 40+ is REX prefix
yes, from what I see it is 40..4F

This is why you see in the 64-bit mode column the letters N.E. bad crash
Post 09 Jul 2010, 15:01
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
Teehee wrote:
[see image]
When/why compiler will choose FF/0 instead 40+rd if using a register?
In 32-bit code fasm will choose the single-byte variant.
In 64-bit code fasm has no choice and "chooses" the two-byte variant.
Post 09 Jul 2010, 15:59
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
hmm.. so is there many ways to do the same?

Manual says FE /0 is to r/m8, but when i look to inc al it shows me:
Code:
FEC0           inc al    

what that C mean? from where it comes?


Last edited by Teehee on 10 Jul 2010, 00:11; edited 1 time in total
Post 10 Jul 2010, 00:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
Teehee wrote:
what that C mean? from where it comes?
Well it is explained in the nice AMD/Intels manuals. modREGr/m - the mod part must be 11b for a register operand.
Post 10 Jul 2010, 00:11
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
oh.. i didn't see yet.. that must happen when you don't use linear reading Smile
sorry to annoy you, uncle revolution. Embarassed

_________________
Sorry if bad english.
Post 10 Jul 2010, 00:15
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.

Powered by rwasa.