🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.corewar
Article #174

Re: ICWS'88 questions

#174
From: Jeff Raven
Date: Mon, 28 Sep 1992 01:51
54 lines
2423 bytes
I can answer a few of these definitely - the modular arithmetic questions
I'll leave to someone else.

In article <1a5la6INN6pq@agate.berkeley.edu>, benrg@ocf.berkeley.edu (Ben
Rudiak-Gould) says:

>The MARS question is:

>   The SLT instruction is supposed to increment the PC a second time
>   if "the A value is less than the B value."  Unfortunately, "less
>   than" is meaningless in modular arithmetic.  How should I perform
>   this comparison?

The SLT comparison is done as though the values weren't actually modular,
but just two positive integers between 0 and (coresize - 1). In other
words, SLT A, B means SKIP if (0 <= A < B).

>   According to ICWS'88, all instructions should include A and B
>   parameters.  Does this mean that instructions like "JMP 10" are
>   illegal?  I would like to be as ICWS'88-compliant as possible,
>   but always having to specify a second parameter seems a bit
>   annoying.

When assembled, every command has an A and a B-field, but every redcode
instruction doesn't have to have both. In particular, JMP, SPL and DAT
may only have one field when written in redcode. For JMP and SPL, the
missing field is assumed to be the B-Field, and it is set to zero. For
DAT, the missing field is assumed to be the A-Field, and is set
to zero.

In short :
         JMP A ---> JMP A, #0
         SPL A ---> SPL A, #0
         DAT A ---> DAT #0, A

>   Labels must start in the first column.  Are instruction mnemonics
>   allowed to start there?

Yes.

>   How do I decide whether to make values relative or absolute?  My
>   instinct is to store an absolute value when the addressing mode
>   is immediate, and a PC-relative value otherwise, but is this
>   "standard" practice?

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.

Hope that helps.

Jeff Raven
jar129@psuvm.psu.edu
Technical Details
Message-ID: <92271.215156JAR129@psuvm.psu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!wupost!uwm.edu!psuvax1!psuvm!jar129
References: <1a5la6INN6pq@agate.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!wupost!uwm.edu!psuvax1!psuvm!jar129
Organization: Penn State University
Date: Sun, 27 Sep 1992 21:51:56 EDT
From: Jeff Raven <JAR129@psuvm.psu.edu>
Message-ID: <92271.215156JAR129@psuvm.psu.edu>
Newsgroups: rec.games.corewar
Subject: Re: ICWS'88 questions
References:  <1a5la6INN6pq@agate.berkeley.edu>
Lines: 54