Assembler for Gameboy games. Currently missing a few instructions, and only supports Gameboy Color-exclusive games with no mapping hardware and no cartridge RAM.
because RGBDS is crappy especially for multi-platform use
but this is even more crappy
that's not important
I don't like LDH/LDI/LDD instead of just LD/the usage of  instead of ()/using 0x instead of $ for hexadecimal/something else
does this support a normal Z80
not really. you might be able to get it to work, but none of the Z80-only instructions are supported, and the LR35902-only instructions are, so you should probably use an actual Z80 assembler
how do I use this
- Make a folder
- Make a file called
info.toml, put this in it: (name is limited to 15 characters, and this file will probably need more settings at some point)
Name = "COOL GAME"
- Make a file called
main.s, put assembly code in there.
gbasmin that folder.
- Do stuff with the
out.gbfile it creates.
- the expression parser likes to assume parentheses and do weird things. for example,
2 - 3 + 4gets interpreted as
2 - (3 + 4), which is probably not what you want
- no MBCs are supported, and rom sizes are assumed to be 32 KiB
- all numbers are assumed to be unsigned -- putting in
-1will give you an error
- you can cause weird unhelpful errors to occur with the dot instructions if you mess with their expected parameters
things that aren't actual LR35902 instructions but that do useful things
ascii "<string>"inserts that string, encoded using ASCII, into the output
asciz "<string>"same as
asciibut terminates the string with a null byte
db <byte>inserts that byte into the output
dw <word>inserts that word into the output
.def <something> <value>defines
<something>as equal to
<value>. useful for registers and things like that
.org <address>sets the origin from that point on to the given address
.incasm "<file>.s"includes everything from that assembly file
Things that are different from other assemblers
- the checksums are automatically calculated, you don't need some other program to fix them for you
0bprefix can be used to make a binary number (for example,
0xprefix can be used to make a hexadecimal number (for example,
$for binary and hexadecimal numbers are not currently supported because I'm lazy