Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

x86_64 assembler "movb" instruction

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  debug framework  
Author Message
mhz

External


Since: Jun 18, 2005
Posts: 24



(Msg. 1) Posted: Thu Feb 14, 2008 10:50 am
Post subject: x86_64 assembler "movb" instruction
Archived from groups: comp>sys>mac>programmer>help (more info?)

The as assembler accept "movb %al,0(%rsi)"
but not "movb %r8,0(%rsi)" (invalid r8 register...)

Why ?

How to put (least significative) byte in r8 to memory 0(%rsi) ? (with a single instruction...)

 >> Stay informed about: x86_64 assembler ""movb"" instruction 
Back to top
Login to vote
mhz

External


Since: Jun 18, 2005
Posts: 24



(Msg. 2) Posted: Tue Feb 19, 2008 7:18 am
Post subject: Re: x86_64 assembler "movb" instruction [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
mhz wrote:

> The as assembler accept "movb %al,0(%rsi)"
> but not "movb %r8,0(%rsi)" (invalid r8 register...)
>
> Why ?
>
> How to put (least significative) byte in r8 to memory 0(%rsi) ? (with a single instruction...)

Solved: add b suffix to register name

movb %r8d,0(%rsi)

It is a little bit redundant...

mov %r8d,0(%rsi)

is also valid.

 >> Stay informed about: x86_64 assembler ""movb"" instruction 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]