Pass output file argument to asma too

This commit is contained in:
Andrew Alderwick 2021-10-13 22:58:17 +01:00
parent e82acc875b
commit 317d71654e
3 changed files with 9 additions and 4 deletions

View File

@ -65,7 +65,7 @@ echo "Assembling(asma).."
./bin/uxnasm projects/software/asma.tal bin/asma.rom ./bin/uxnasm projects/software/asma.tal bin/asma.rom
echo "Assembling(piano).." echo "Assembling(piano).."
echo projects/examples/demos/piano.tal | bin/uxncli bin/asma.rom > bin/piano.rom 2> bin/piano.log bin/uxncli bin/asma.rom projects/examples/demos/piano.tal bin/piano.rom 2> bin/piano.log
echo "Running.." echo "Running.."
./bin/uxnemu bin/piano.rom ./bin/uxnemu bin/piano.rom

View File

@ -6,7 +6,7 @@ mkdir asma-test
expect_failure() { expect_failure() {
cat > asma-test/in.tal cat > asma-test/in.tal
echo asma-test/in.tal | bin/uxncli asma-test/asma.rom > asma-test/out.rom 2> asma-test/asma.log bin/uxncli asma-test/asma.rom asma-test/in.tal asma-test/out.rom 2> asma-test/asma.log
if ! grep -qF "${1}" asma-test/asma.log; then if ! grep -qF "${1}" asma-test/asma.log; then
echo "error: asma didn't report error ${1} in faulty code" echo "error: asma didn't report error ${1} in faulty code"
cat asma-test/asma.log cat asma-test/asma.log
@ -27,7 +27,7 @@ for F in $(find projects -path projects/library -prune -false -or -type f -name
xxd "${UASM_BASE}.rom" > "${UASM_BASE}.hex" xxd "${UASM_BASE}.rom" > "${UASM_BASE}.hex"
ASMA_BASE="asma-test/asma-$(basename "${F%.tal}")" ASMA_BASE="asma-test/asma-$(basename "${F%.tal}")"
echo "${F}" | bin/uxncli asma-test/asma.rom > "${ASMA_BASE}.rom" 2> "${ASMA_BASE}.log" bin/uxncli asma-test/asma.rom "${F}" "${ASMA_BASE}.rom" 2> "${ASMA_BASE}.log"
if ! grep -qF 'bytes of heap used' "${ASMA_BASE}.log"; then if ! grep -qF 'bytes of heap used' "${ASMA_BASE}.log"; then
echo "error: asma failed to assemble ${F}, while uxnasm succeeded" echo "error: asma failed to assemble ${F}, while uxnasm succeeded"
cat "${ASMA_BASE}.log" cat "${ASMA_BASE}.log"

View File

@ -31,7 +31,12 @@
DUP EOR ( 00 ) DUP EOR ( 00 )
;append-heap-byte JSR2 ( ) ;append-heap-byte JSR2 ( )
;asma-heap #0000 ;asma-assemble-file JSR2 ,&output-file LDR2 EOR ,&run JCN
;heap LDA2 ,&output-file STR2
BRK
&run
;asma-heap LIT2 &output-file $2 ;asma-assemble-file JSR2
#01 .System/halt DEO #01 .System/halt DEO
BRK BRK