From d34ec6584c85d9a3f7fa9613c124e50fb91ca4c5 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Thu, 7 Oct 2021 21:59:49 +0100 Subject: [PATCH] Added option to write ROM to stdout (when dest-filename is null). --- projects/library/asma.tal | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/projects/library/asma.tal b/projects/library/asma.tal index 34f5282..8b33bae 100644 --- a/projects/library/asma.tal +++ b/projects/library/asma.tal @@ -33,6 +33,9 @@ ;asma-init-next-pass JSR2 ;asma-flush-to-file ;asma/flush-fn STA2 + ;asma/dest-filename LDA2 ORA ,&filename-present JCN + ;asma-flush-to-console ;asma/flush-fn STA2 + &filename-present ;asma/src-filename LDA2 ;asma-assemble-file-pass JSR2 asma-IF-ERROR ,&error JCN @@ -499,6 +502,20 @@ include projects/library/string.tal ;asma-write-buffer .File/save DEO2 JMP2r +@asma-flush-to-console ( len* -- ) + ORAk ,¬-empty JCN + POP2 JMP2r + + ¬-empty + ;asma-write-buffer DUP2 ROT2 ADD2 SWP2 ( end* ptr* ) + &loop ( end* ptr* ) + LDAk .Console/write DEO + INC2 + GTH2k ,&loop JCN + + POP2 POP2 + JMP2r + include projects/library/heap.tal (