EXAPUNKS

EXAPUNKS

147 ratings
EXA Quick Reference
By Jeeva
A quick reference for the language used to control EXAs
8
   
Award
Favorite
Favorited
Unfavorite
Introduction
Here's a quick-reference guide to the language used in EXAPUNKS to control EXAs.
Basic Commands
Command
Syntax
Usage
COPY
R/N R
Copy the specified value to the specified register
ADDI
R/N R/N R
Adds the first two values and stores the result in the specified register
SUBI
R/N R/N R
Subtracts the second value from the first and store the result in the specified register
MULI
R/N R/N R
Multiplies the first two values and stores the result in the specified register
DIVI
R/N R/N R
Return how many times the second value fits completely into the first value, and stores it in the specified register
MODI
R/N R/N R
Returns the modulus of a division operation and stores it in the specified register
SWIZ
R/N R/N R
Modifies the given number according to a mask (Please see the section labelled "Swizzle")
MARK
L
Create a label with the specified name. Does not add to the line count - similar to NOTE
JUMP
L
Jumps to the specified label
TJMP
L
Jumps to the specified label if the T register is greater than 0
FJMP
L
Jumps to the specified label if the T register is 0
TEST
R/N =/</> R/N | EOF | MRD
Tests the specified condition, writing the result to T. Please see the "Testing" section
REPL
L
Creates a new EXA running from the specified label
HALT
Kills the current EXA, dropping any held file
KILL
Kills a random EXA in this host (Prefers EXAs owned by the player)
LINK
R/N
Traverses the specified link
HOST
R
Writes the current host name to the specified register
MODE
Toggles the M register's access mode between Local and Global
VOID
M/F
Removes the current value from the currently held file / M register
MAKE
Create a new file, held by this EXA
GRAB
R/N
Grab the specified file
FILE
R
Write the current file name to the specified register
SEEK
R/N
Move X values in the held file, where X can be between -9999 and 9999
DROP
Drops the currently held file
WIPE
Deletes the currently held file
NOTE
Note instructions do not count towards the line-count
NOOP
Do nothing for 1 cycle
Testing
The TEST command has many uses.

All uses of TEST overwrite the T register with 1 (true) or 0 (false).

This can be used to trigger jumps to labels, with TJMP and FJMP.

You can use TEST EOF to check if the file-pointer is at the end of the current file.

You can use TEST MRD to check if there is anything available to read on the M register.
Swizzle
SWIZ allows you to modify a number.

You pass the original number (or location/register) as the first argument, a mask to apply (or the location/register containing it) to the second argument, and the register to store the result in as the third.

The mask should be a number of up to four digits consisting of digits 0-4.

Unusual Commands
Command
Syntax
Usage
RAND
R/N R/N R
Only available in some challenges
DATA
N N N ?
Only available in REDSHIFT, this specifies a file for an EXA to begin holding
WAIT
Only available in REDSHIFT, this waits for the next frame render
10 Comments
gardenapple Jun 25 @ 1:14pm 
TJMP will also jump if T contains a word, since words are "not equal to 0".
wi1d3 Aug 26, 2023 @ 3:24am 
TJMP will jump when T is ANYTHING OTHER THAN 0
Not just when it's greater than 0.
For example T = -1 will cause a jump.
595Blue Jun 27, 2023 @ 9:31pm 
For peaslee:
Digits that aren't 1, 2, 3 or 4, when used as a mask in a SWIZ command, will insert a zero. Great for those [rare] times when you need to null out a specific digit or insert some padding.
ElNico56 Jul 1, 2021 @ 10:32pm 
@REP 4
LINK @{803,2}
@END

Would be a better way to do what Gargish said
L4z3r Jan 21, 2019 @ 8:54pm 
I believe MARK does count towards size / line count.
Zane49er Oct 12, 2018 @ 11:25pm 
Semicolons work as notes.
;HELLO
is the same as
NOTE HELLO
Gargish🐸 Aug 19, 2018 @ 2:22pm 
Adding to weev's macro comment: Macro counter substitution

@REP 4
LINK 80@{3,2}
@END

expands to

LINK 803
LINK 805
LINK 807
LINK 809

that is, first number in braces is the initial value, the second is the step count, and since it is just a text replacement you can string it together with other text.
skellington Aug 16, 2018 @ 3:03pm 
Using

@REP N
thing to repeat
@END

is a hidden convenience for repeating something a fixed number of times - I don't think you can use a register in place of N.

@REP 5
copy m x
@END

expands at runtime to

copy m x
copy m x
copy m x
copy m x
copy m x

You can also alt-click on a line to run the program to that point, like a breakpoint. Not sure if there are any other hidden gems like this.
peaslee Aug 16, 2018 @ 9:54am 
You can use a one-digit mask with SWIZ.

SWIZ 1234 2 X (copies 3 into X)
Statement Aug 15, 2018 @ 5:55pm 
MARK adds to size, but not to cycles. Rather strange, since one would presume it's a precompiled address, however EXAPUNKS doesn't support absolute or relative branching so it's its own goofy thing.