9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] assembler question
@ 2004-10-30  2:32 Tim Newsham
  2004-10-30  2:58 ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Newsham @ 2004-10-30  2:32 UTC (permalink / raw)
  To: 9fans

Is it possible to generate a 3-address ADD instruction for
the 3-address machines (such as sparc using ka)?   Without
resorting to laying down the opcode manually, of course.

Tim N.


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

* Re: [9fans] assembler question
  2004-10-30  2:32 [9fans] assembler question Tim Newsham
@ 2004-10-30  2:58 ` Russ Cox
  2004-10-30  3:04   ` Tim Newsham
  0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2004-10-30  2:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Is it possible to generate a 3-address ADD instruction for
> the 3-address machines (such as sparc using ka)?   Without
> resorting to laying down the opcode manually, of course.

Looking at /sys/src/cmd/ka/a.y:208, it appears you 
can just say ADDW r2, r3, r4.  Have you tried this?

Russ


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

* Re: [9fans] assembler question
  2004-10-30  2:58 ` Russ Cox
@ 2004-10-30  3:04   ` Tim Newsham
  2004-10-30  9:24     ` Charles Forsyth
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Newsham @ 2004-10-30  3:04 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs

> Looking at /sys/src/cmd/ka/a.y:208, it appears you
> can just say ADDW r2, r3, r4.  Have you tried this?

Ahh.. I was trying "ADD R1, $1, R2" but "ADD $1, R1, R2" seems
to have worked.  Sorry to raise a false warning.

> Russ

Tim N.


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

* Re: [9fans] assembler question
  2004-10-30  3:04   ` Tim Newsham
@ 2004-10-30  9:24     ` Charles Forsyth
  0 siblings, 0 replies; 4+ messages in thread
From: Charles Forsyth @ 2004-10-30  9:24 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

be careful that all the plan 9 assemblers always use source -> dest
data flow order for instructions, which can differ from the (sometimes inconsistent)
order used by others.  (i quite like this because once you know the rule,
you won't get screwed up writing code for several architectures in the same hour,
as i do, but it needs some attention if you're working from another code sample
where the conventions are different.)

[-- Attachment #2: Type: message/rfc822, Size: 2638 bytes --]

From: Tim Newsham <newsham@lava.net>
To: Russ Cox <russcox@gmail.com>, Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Cc: 
Subject: Re: [9fans] assembler question
Date: Fri, 29 Oct 2004 17:04:11 -1000 (HST)
Message-ID: <Pine.BSI.4.58.0410291703150.24294@malasada.lava.net>

> Looking at /sys/src/cmd/ka/a.y:208, it appears you
> can just say ADDW r2, r3, r4.  Have you tried this?

Ahh.. I was trying "ADD R1, $1, R2" but "ADD $1, R1, R2" seems
to have worked.  Sorry to raise a false warning.

> Russ

Tim N.

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

end of thread, other threads:[~2004-10-30  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-30  2:32 [9fans] assembler question Tim Newsham
2004-10-30  2:58 ` Russ Cox
2004-10-30  3:04   ` Tim Newsham
2004-10-30  9:24     ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).