I was too lazy to provide any examples, so here is a short intro:
there are 64x64 (=4096) bytes of data in the memory. The last 8 bytes of these are reserved for the program counter (2B), the carry bit (1B), the interrupt (1B) and the system clock (4B).
One byte is made up of a 2x1 tile area, which can be populated by 2 buildings. These buildings represent the data (speedmod is recommended for getting about, and an unltimited build script, also not included, is necessary for proper programs. Also a lot of health. Automatically generated turrets of the opposite team may try to kill you).
These are the 16 values a half-byte (tile) can have:
0: [nothing]
1: T Barbed Wire
2: T Barricade
3: T Wall I
4: T Wall II
5: T Wall III
6: T Turret
7: T Supply
8: Any CT building or mine (not recommended) not listed
9: CT Barbed Wire
A: CT Barricade
B: CT Wall I
C: CT Wall II
CT Wall III
E: CT Turret
F: CT Supply
The op-codes take up 1 Byte, all further data is given in the brakets after and represent the bytes reserved for data after the op-code)
There are currently 15 operations defined, these are:
0:
NOP - the program stops (but is not aborted - the clock will continue to run!)
1:
writeRegister(1B register, 1B value) - write a value to a register
2:
copyRegister(0.5B regA, 0.5B regB) - copy the value of one register to another
3:
registerToMemory(1B Register, 2B Memory Address) - copy the value of a register to memory
4:
MemoryToRegister(2B Memory Address, 1B Register) - copy the value from a address in memory to a register
5:
jump(2B MemAddr) - jump the program counter to a new location in memory
6:
jumpEquals(0.5B regA, 0.5B regB, 2B MemAddr) - jump the program counter to a new location in memory if the two given registers have equal values
7:
jumpLessThan(0.5B regA, 0.5B regB, 2B MemAddr) - jump the program counter to a new location in memory if regA has a smaller value than regB
8:
add(0.5B regA, 0.5B regB) - add the value of register B to register A
9:
subtract(0.5B regA, 0.5B regB) - subtract the value of register B from register A
A:
multiply(0.5B regA, 0.5B regB) - multiply the value of register B to register A, with overflow bits written to register B.
B:
divide(0.5B regA, 0.5B regB) - divide the value of register A by register B, with remainder written to register B.
C:
and(0.5B regA, 0.5B regB) - bitwise and the value of register B to register A
or(0.5B regA, 0.5B regB) - bitwise or the value of register B to register A
E:
not(0.5B regA, 0.5B regB) - bitwise not the value of register B and register A. If you want to only not one register, use the same for both parameters.
F:
xor(0.5B regA, 0.5B regB) - bitwise xor the value of register B to register A
A big shoutout to the people who implemented bitwise operators in lua 5.3 - why would anyone ever feel the need to leave them out of a language?