ANATID Docs

ANATID is a pseudo-assembly language made for ANATID's in-browser virtual machine.

Argument Types

- INT: A whole number, positive or negative. If you replace an INT type argument with an ADDRESS in your code, the VM will use the ADDRESS' value as the INT

- ADDRESS: A specific coordinate in the memory map that holds an INT. Written as $YX (a dollar sign followed by the alphanumeric characters corresponding to the Y and X coordinates)

- NAME: A string of letters (without spaces) that is used to name simulated objects

- STRING: A string of letters, numbers, and spaces. No quotation marks are required to use a STRING (ANATID is smart enough to tell what is and isn't a string)

Input

- You may notice that you are unable to store values to any ADDRESS that starts with 0 (ex: $00, $01, $0A, $0W, etc). This is because these memory addresses are reserved for keyboard input.

- Addresses in the 0 row will be set to 1 if the corresponding key is held down, and 0 otherwise.

- The 2nd character of the memory address determines the corresponding key (ex: $03 represents the "3" key, $0F represents the "F" key)

Your Environment

- Memory Map: Shows the value held in each memory location; In the bottom left corner of your screen

- Video Output: Shows the visual output of your code; In the top right of your screen. The video output is 100x100 pixels.

Instructions

ANATID only has 25 total instructions. Here are each of them:

Math

- ADD [INT]: Adds the INT to the accumulator

- SUB [INT]: Subtracts the INT from the accumulator

- MUL [INT]: Multiplies the accumulator by the INT

- DIV [INT]: Divides the accumulator by the INT, returns a whole number

- MOD [INT]: Sets accumulator to the remainder of division when the accumulator is divided by the INT

- RANDOM [INT]: Sets the accumulator to a random number between 0 and the INT (inclusive)

Memory

- LOAD [INT]: Loads the INT into the accumulator

- STORE [ADDRESS]: Stores the accumulator value at the ADDRESS

- CLEAR [ADDRESS]: Sets that value at the ADDRESS to 0

Comparisons

- EQUAL [INT]: Sets accumulator to 1 if the INT is equal to the accumulator, sets it to 0 otherwise

- GREATER [INT]: Sets accumulator to 1 if the INT is greater than the accumulator, sets it to 0 otherwise

- LESS [INT]: Sets accumulator to 1 if the INT is less than the accumulator, sets it to 0 otherwise

- NOT: Sets accumulator to 1 if the accumulator is 0, sets it to 0 otherwise

- AND [INT]: Sets accumulator to 1 if the INT and the accumulator are not 0, sets it to 0 otherwise

- OR [INT]: Sets accumulator to 1 if the INT and/or the accumulator are not 0, sets it to 0 otherwise

Logic, Loops & Branching

- IF [INT]: Skips the next INT lines if the accumulator is equal to 0

- LABEL [NAME]: Marks a place in the code that you can jump to using JUMP [NAME]

- JUMP [NAME]: Jumps to the label NAME

- FUNCTION [NAME]: Marks a reusable part of your code that can be called with CALL [NAME]

- RETURN: Marks the end of a function and returns to the last "CALL" instruction

- CALL [NAME]: Executes the function NAME

Scripting

- WAIT [INT]: Waits INT milliseconds before continuing

Graphics

- PAINT [INT x] [INT y]: Paints the pixel at (x,y) with the color stored in the accumulator

- PAINT [INT x] [INT y] [INT w] [INT h]: Paints a rectangle with the color stored in the accumulator

- PRINT [INT x] [INT y] [STRING text]: Prints the text at (x,y) with the color stored in the accumulator

Comments

- Use a semicolon (;) to indicate a comment