-
ACME like syntax
-
Aims to be on par with Kickassembler in automation/scriptability, but with less complexity
-
Unit tests through internal emulator
-
Open and easily extendable source
User manual: http://apone.org/bass/
Tutorial: http://apone.org/bass/part1.html
VRAM_LO = $9f00
VRAM_HI = $9f01
!macro SetVRAM(a) {
.lo = <a;
.hi = >a;
lda #.lo
sta VRAM_LO
!if .lo != .hi { lda #.hi }
sta VRAM_HI
}
!section "main", $1000
start:
; Clear 1K
ldx #0
$ !rept 4 { sta $1000+i*256,x }
dex
bne -
SetVRAM(0x1234)
ldx #end - text
$ lda start,x
sta $1000,x
dex
bne -
rts
text:
!byte "Text to copy", 0
end:
; --- Generate sine table with and without LUA
mysin = [x, amp, size ->
(sin(x * Math.Pi * 2 / size) * 0.5 + 0.5) * amp ]
sin:
!rept 100 { !byte mysin(i, 255, 100) }
%{ -- LUA code
function make_sin(amp, size)
res = {}
for i=0,size-1,1 do
res[i+1] = (math.sin(i * math.pi * 2/ size) * 0.5 + 0.5) * amp
end
return res
end
}%
sin2:
!fill make_sin(255, 100)
!assert make_sin(5, 5)[1] == round(mysin(1, 5,5))
!assert make_sin(5, 5)[3] == round(mysin(3, 5,5))