Added option to write ROM to stdout (when dest-filename is null).

This commit is contained in:
Andrew Alderwick 2021-10-07 21:59:49 +01:00
parent 8a74c3455d
commit d34ec6584c
1 changed files with 17 additions and 0 deletions

View File

@ -33,6 +33,9 @@
;asma-init-next-pass JSR2 ;asma-init-next-pass JSR2
;asma-flush-to-file ;asma/flush-fn STA2 ;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/src-filename LDA2 ;asma-assemble-file-pass JSR2
asma-IF-ERROR ,&error JCN asma-IF-ERROR ,&error JCN
@ -499,6 +502,20 @@ include projects/library/string.tal
;asma-write-buffer .File/save DEO2 ;asma-write-buffer .File/save DEO2
JMP2r JMP2r
@asma-flush-to-console ( len* -- )
ORAk ,&not-empty JCN
POP2 JMP2r
&not-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 include projects/library/heap.tal
( (