🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.corewar
Article #183

Re: ICWS'88 questions

#183
From: Ben Rudiak-Gould
Date: Tue, 29 Sep 1992 06:13
36 lines
1711 bytes
>>   How do I decide whether to make values relative or absolute?

Jeff Raven <JAR129@psuvm.psu.edu> writes:

>When you assemble a redcode program, you don't change any of the values
>of the fields (aside from converting them modulo coresize). When executing
>the program, then, yes, immediate mode is absolute, while all others are
>relative.

I should have made my meaning more clear.  What I'm worried about is
something like this:

alpha	equ	1+1
beta	equ	label-3
gamma	equ	label2-label

	dat	#alpha
	dat	#beta
	dat	#gamma
label	spl	666
label2	jmp	label

Now, the first data statement should obviously evaluate to dat #2
(that's absolute).  The second would make more sense if it evaluated
as dat #-1 (that's relative).  The third should probably evaluate to
dat #1 (the number of core locations from label to label2), since the
relative addressing would "drop out" when subtracting two labels
(that's absolute).  My question should have been, "How does the
assembler make this determination?"

--
Ben Rudiak-Gould
benrg@ocf.berkeley.edu  <== send mail to this address, even though I'm
                            posting this particular article from
                            nyx.cs.du.edu.
Technical Details
Message-ID: <1992Sep29.061348.29540@mnemosyne.cs.du.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!mnemosyne.cs.du.edu!nyx!brudiakg
References: <1a5la6INN6pq@agate.berkeley.edu> <92271.215156JAR129@psuvm.psu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: rec.games.corewar
Path: arc1-ca.pugleaf.net!sparky!uunet!mnemosyne.cs.du.edu!nyx!brudiakg
From: brudiakg@nyx.cs.du.edu (Ben Rudiak-Gould)
Subject: Re: ICWS'88 questions
Message-ID: <1992Sep29.061348.29540@mnemosyne.cs.du.edu>
Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
Organization: University of Denver, Dept. of Math & Comp. Sci.
References: <1a5la6INN6pq@agate.berkeley.edu> <92271.215156JAR129@psuvm.psu.edu>
Date: Tue, 29 Sep 92 06:13:48 GMT
Lines: 36