A different take on Assembly, with the goal of creating tiny executables.
BSD-3-CLAUSE License
Build and install Battlestar, build the samples and run the "life" sample:
make; sudo make devinstall; make samples; cd life; ./life.sh; cd ..
This requires DosBox, Go, Yasm and GCC.
Build and boot a kernel (requires GCC, Yasm, Battlestar and the qemu-system-i386
executable):
cd kernel/simple; make boot; cd ../..
#!/usr/bin/bts
gccgo
is not supported yet.This is a 16-bit x86 program, for DOS:
// "Life"
// The original was written by "melezov" (http://256bytes.untergrund.net/demo/334)
fun main
al = 0x13 // set graphics mode (mode 13h)
// 320x200, 256 colors, one byte per pixel
int 10
stack -> sp // pop sp
stack -> b // pop bx
stack -> ds // pop ds
ds -> es // push ds, pop es
al = 62
ch = 0xFA
loopwrite // rep stosb
loop
di <<< 3 // rotate left 3
di -= 7 // subtraction
di ^= 2 // xor
al = readbyte di // read byte from memory
al += [di+321] // add value at [di+321] (pixel on the line below)
al /= 2
di -> stack
write // stosb
write
di += 0x13E
write
write
stack -> di
end // loops forever
end
Make sure Go, Yasm and GCC are installed.
Installation:
sudo make PREFIX=/usr install
For development, install soft links instead:
sudo make install-dev
Build all the samples:
make samples