diff --git a/cpclib-bndbuild/tests/jinja/bndbuild.yml b/cpclib-bndbuild/tests/jinja/bndbuild.yml index 76ed9d55..52586871 100644 --- a/cpclib-bndbuild/tests/jinja/bndbuild.yml +++ b/cpclib-bndbuild/tests/jinja/bndbuild.yml @@ -1,8 +1,38 @@ -{% set source = "test.asm" %} +#!/bndbuild +# bndbuild -DCPCADDR= m4 if you want a specific address for the M4 +# bndbuild -DASSEMBLER=rasm m4 if you want to assemble with rasm (needs to be on the PATH) instead of basm +# bndbuild DASSEMBLER=rasm --dot | dot -Tpng | display if you want to see the dependency tree for rasm-based construction + +{%- if not CPCADDR -%} +{%- set CPCADDR = "192.168.1.26" -%} +{%- endif -%} +{{ASSEMBLER}} + +{%- if not ASSEMBLER -%} +{%- set ASSEMBLER = "basm" -%} +{%- endif -%} +{{ASSEMBLER}} + +{%- macro assemble(base) -%} +{%- if ASSEMBLER == "rasm" -%} + extern rasm {{base}} +{%- elif ASSEMBLER == "basm" -%} + basm {{base}} +{%- else -%} +{{- fail("wrong ASSEMBER value: " + ASSEMBLER) }} +{%- endif -%} +{%- endmacro -%} + +{%- set source = "test.asm" -%} +{%- set prog = "TEST" %} - dep: {{source}} - tgt: test.o - cmd: basm {{source}} -o test.o + tgt: {{prog}} + cmd: {{assemble(source)}} - tgt: distclean - cmd: -rm test.o \ No newline at end of file + cmd: -rm {{prog}} + +- dep: {{prog}} + tgt: m4 + cmd: xfer {{CPCADDR}} -y {{prog}} diff --git a/cpclib-bndbuild/tests/jinja/test.asm b/cpclib-bndbuild/tests/jinja/test.asm index 4dfc5065..faf2dea4 100644 --- a/cpclib-bndbuild/tests/jinja/test.asm +++ b/cpclib-bndbuild/tests/jinja/test.asm @@ -1,2 +1,22 @@ - org 0x100 - jp $ \ No newline at end of file + org 0x1000 + run $ +beginning + + ld hl, data +loop + ld a, (hl) + or a : jp z, $ + call 0xbb5a + inc hl + jp loop + +data + db "HELLO WORLD FROM " + ifdef BASM + db "basm" + else + db "rasm" + endif + db 0 + + save "TEST", beginning, $-beginning, AMSDOS \ No newline at end of file