flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > OR instruction

Author
Thread Post new topic Reply to topic
Fatih



Joined: 13 Nov 2010
Posts: 6
Fatih
Code:
use64

main:
        or      rax,0xfffffff0
        ret

    


when i used "or instruction" on 64 bit code, i get compiler error "value out of range"

AMD64 Architecture Programmer’s Manual Volume 3:
----------------------------------------------------------------------
OR reg/mem64, imm32
Post 23 Nov 2010, 10:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
Fatih wrote:

AMD64 Architecture Programmer’s Manual Volume 3:
----------------------------------------------------------------------
OR reg/mem64, imm32
This is the signed immediate value. Did you mean
Code:
or rax,-10h    
?
If you wanted the unsigned 0xfffffff0 value (with higher 32 bits zeroed) as immediate, then there's no OR form that would do that in long mode - thus the error.
Post 23 Nov 2010, 10:42
View user's profile Send private message Visit poster's website Reply with quote
Fatih



Joined: 13 Nov 2010
Posts: 6
Fatih
Thanks Tomasz for Quick Reply
Post 23 Nov 2010, 10:50
View user's profile Send private message Visit poster's website 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.