As much as I would love to sink hours into troubleshooting CRLF issues, I truly have better things to do; Git converts LF into CRLF and the interpreter doesn't like that, so make sure you convert them back to LF!
Put .basm scripts in the resources/ folder. Not included in this repository are the include files, libraries, and .dlls for SDL2 and SDL2_image.
Compile on Windows from a Visual Studio console with the build.bat script.
[0-9]+decimalx[0-9a-f]+hexb[01]+binary
In opcode descriptions, [R] means any register (axy), [N] means any integer, [A] means any address. [L] means a label. Addresses are indirect references; e.g. lda #0 will place the value located at memory address 0 in the accumulator. Most [RNA] commands will accept a second [RNA] parameter separated by a comma; this will produce a reference to a memory address where the second parameter acts as an offset.
There are 4 processor flags: Carry, Zero, Parity, and Sign. Various operations set them in different ways.
ld[R] [RNA]: Load a value in a registerst[R] [RNA]: Store a register's valueinc: Increment the accumulatordec: Decrement the accumulatoradd [RNA]: Add a value to the accumulatorsub [RNA]: Subtract a value from the accumulatorcmp [RNA]: Compare a value to the accumulatorjmp [L]: Move the code pointer in memoryjc [L]/jnc [L]: Jump ifCis (not) setjz [L]/jnz [L]: Jump ifZis (not) setjpe [L]/jpo [L]: Jump ifPis (not) setjm [L]/jp [L]: Jump ifSis (not) setcall [L]: Push the code pointer to the call stack and move to a labelret: Pop the topmost entry of the call stack and move the code pointer there For each of these jump instructions, there is a correspondingc(call) instruction that pushes the current code pointer to the call stack and ar(return) instruction that pops it.push [R] / pop [R]: Push/pop data onto the stack from a register
You can write to anywhere in this region.
There are 32 8x8 sprites available for use. Sprites can be disabled by setting their color to black (0xFFFFFF).
- 8x8 pixel data (8 bytes)
- Laid out by row, leftmost pixel on most significant bit
- Position (2 bytes)
- Color (3 bytes)
- 3 blank bytes