Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Subject: Re: Confusing assebmler
Date: 02 Feb 2003 21:51:45 +0100	[thread overview]
Message-ID: <873cn6xv6m.fsf@student.uni-tuebingen.de> (raw)
In-Reply-To: b1jtlc$pn$2@news.oamk.fi

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


      reply	other threads:[~2003-02-02 20:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-02 20:05 Confusing assebmler Juhana Paavola
2003-02-02 20:51 ` Falk Hueffner [this message]
read-only archive

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