flat assembler
Message board for the users of flat assembler.

Index > Main > mov rax in fasm 1.71.16

Author
Thread Post new topic Reply to topic
ToTamir



Joined: 11 Jan 2014
Posts: 1
ToTamir 11 Jan 2014, 09:49
Why
Code:
mov rax,16777216    

is 7 bytes ( 48 C7 C0 00 00 00 01 )

and
Code:
mov rax,4294967295    

is 10 bytes ( 48 B8 FF FF FF FF 00 00 00 00 )?

I don't understand it. The same 64 bit register but different opcodes?
Post 11 Jan 2014, 09:49
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 11 Jan 2014, 10:06
here are the relevant entries in the intel docs:
Code:
REX.W + B8 + rd io
 MOV r64, imm64
  Move imm64 to r64

REX.W + C7 /0 io
 MOV r/m64, imm32
  Move imm32 sign extended to 64-bits to r/m64    

Intel tries to compress the op-codes whenever possible, which is why they are so much work to decode.
Post 11 Jan 2014, 10:06
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.