Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Confusing assebmler
@ 2003-02-02 20:05 Juhana Paavola
  2003-02-02 20:51 ` Falk Hueffner
  0 siblings, 1 reply; 2+ messages in thread
From: Juhana Paavola @ 2003-02-02 20:05 UTC (permalink / raw)


I'm having problems with Alpha assembler.
When I'm trying to move longwords to some register, gas warns it.

eg.
	addq $16,0xffff,$16

Warning: operand out of range (65535 not between 0 and 255)

How should I move/add/etc long/quad words to registers ?
It seems that only words can be moved.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Confusing assebmler
  2003-02-02 20:05 Confusing assebmler Juhana Paavola
@ 2003-02-02 20:51 ` Falk Hueffner
  0 siblings, 0 replies; 2+ messages in thread
From: Falk Hueffner @ 2003-02-02 20:51 UTC (permalink / raw)


Juhana Paavola <jupaavol@ruutana.ratol.fi> writes:

> I'm having problems with Alpha assembler.
> When I'm trying to move longwords to some register, gas warns it.
> 
> eg.
> 	addq $16,0xffff,$16
> 
> Warning: operand out of range (65535 not between 0 and 255)
> 
> How should I move/add/etc long/quad words to registers ?
> It seems that only words can be moved.

You need to put the constant into a register first. With lda, you can
generate constants between -32768 and 32767. So in this case, you also
need ldah. ldah r1, x(r0) does r1 = r0 + 65536 * x. So to emit 0xffff,
you need

        ldah    $1, 1($31)
        lda     $1, -1($1)

Or you can use the "ldiq" pseudo-op, which will generate multiple
instruction sequences itself:

        ldiq    $1, 0xffff

If you want to add 0xffff to $16, you can do

        ldah    $16, 1($16)
        lda     $16, -1($16)

-- 
	Falk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-02 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-02 20:05 Confusing assebmler Juhana Paavola
2003-02-02 20:51 ` Falk Hueffner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox