

                         ------>  Redcode!!  <-------


     All Redcode stuff in BACS is based off of A. K. Dewdney's book
     "The Magic Machine, A Handbook of Computer Sorcery" as of 1990.



Part 1- Converting Redcode to BABL

Part 2- Using Redcode programs under BACS.





-----PART 1-----

   Here are a few pointers in converting redcode programs over to BABL.

  [ Remember- the redcode compiler in BACS is not yet fully functional ]


1.  Change all CMP's to IFE's.

2.  On ADD, SUB, and MOV commands, you need to switch the two operands.

3.  On all commands that have a '@', change the '@' to a '&'.

4.  On all numbers that don't have a symbol (such as '#' or '@'), put a 
    '@' on it.

5.  Anytime you see a program trying to bomb places by sending immediates
    to the location, change it to move an entire DATA statement. Sending 
    immediates in Binary Armageddon won't make the target location non-
    executable, instead it will only change the second operand. Any DATA
    statement will do, since all DATA statements are non-executable.

6.  Make sure the first statement in the program is executable!! Some 
    programs start with data, and thus will die when programmed as a
    BABL program!



  Some of the differences are quite profound, yet others are hidden and
can cause headaches if you don't know precisely how things work. To
clear things up a bit, I have included below some examples of the
differences between Binary Armageddon, Core Wars, Redcode, and BABL.
The statements here about CoreWars and Redcode are from what I have read.
Since what I read was written in 1990, it is possible that it has changed
slightly since. Here are the most notable differences:


  - Redcode has 9 commands (more with the newer versions of Redcode).
  = BABL has 31 commands.

  - Redcode truly treats each memory location as a whole. If you compare
    an immediate with a memory location, the immediate must account for
    the command and operands (usually not a concern since DAT commands
    have 0's for everything except the last operand, so the whole thing is
    equal to the number it was initally assigned).
  = This isn't necessarily so in BABL. BABL treats each memory location as
    one big number only when you use a CMP with both operands being
    addresses, or a MOV with the first operand (target) being an address
    (instead of a register). 
    





-----PART 2-----

  BACS now supports Redcode programs!!! 



  A few things must be noted before attempting to use one however:

  1.  Make sure that in the redcode program file, "-redcode" appears
      before any commands. This tells the compiler that the program is
      in fact written in redcode. The is particularly inportant since 
      some commands (such as MOV, ADD, etc) are backwards in relation to 
      each other between the two languages, and because CMP in redcode is
      just like IFE in BABL.

  2.  After it's compiled, you'll need to tell it which command to execute
      first. Be prepared to do so.

  3.  Don't mix BABL and Redcode together when you compile a program as
      Redcode. You may get some unusual side-effects (most certainly!!)

  4.  Not all Redcode will work. For instance, jumps with indirect
      addresses will not function properly. These things aren't going
      to be cleaned up anytime soon, so don't get overly frustrated
      with it if a program doesn't work. The redcode support is just
      to allow you to use the simpler Redcode programs, without doing
      a complete overhaul to convert them to BABL.

  5.  The newer commands in Redcode are not supported, such as SPL and
      PCT. A version of SPL 'might' be added later, but don't count on PCT.


