Welcome GuestLogin

Programming Games Wiki

RSS RSS

Search

»

Explore


Share




BOX-256

RSS
Modified on 2016/04/26 20:23 by 84.51.143.223 Categorized as Uncategorized
Image
BOX-256 is a game played by writing assembly code to pass graphics tests.

Table of Contents [Hide/Show]


Edit

History

BOX-256 was released for Windows and as an in-browser game by Juha Kiili in April 2016. The first release includes 4 puzzles. v1.1 adds another 8 puzzles and two new opcodes.

Edit

Programming

The BOX-256 virtual CPU supports 13 instructions:

InstructionDescription
MOV A B Ccopy C cells from A to B
PIX A Bdisplay a pixel of colour B in location A
FLP A B Cexchange C cells at A and B
ADD A B CSet C = A + B
SUB A B CSet C = A - B
MUL A B CSet C = A * B
DIV A B CSet C = A / B
MOD A B CSet C = A % B (added in v1.1)
JMP Ajump to the instruction at A
JEQ A B Cjump to the instruction at C if A = B
JNE A B Cjump to the instruction at C if A != B (added in v1.1)
JGR A B Cjump to the instruction at C if A > B
THR Astart a new thread at A

There are three different addressing modes:

ModeDescription
0constant
@address
*pointer

The instruction pointer is stored in address @FF. The instruction pointer for any additional threads is stored at @FE, @FD, etc. Edit

Example

The following example displays a checkerboard pattern:

FLP @16 @17 001
PIX 000 @17 000
ADD 010 @05 @05
JGR @05 00F @00
ADD 001 @05 @05
JMP @04 002 003

Edit

Inspired By


Edit

External Links

  Name Size
- box256.png 21.14 KB