(format-c) Use file name
This commit is contained in:
parent
251c2bf6a0
commit
c08a44ae0f
|
@ -22,7 +22,9 @@
|
|||
@<print-program> ( src* -- )
|
||||
;src .File/name DEO2
|
||||
#0001 .File/length DEO2
|
||||
;dict/header <pstr>
|
||||
;dict/a <pstr>
|
||||
;src <print-name>
|
||||
;dict/b <pstr>
|
||||
[ LIT2r 0000 ]
|
||||
&stream ( -- )
|
||||
;&buf feof ?&end
|
||||
|
@ -37,7 +39,15 @@
|
|||
#0918 DEO }
|
||||
!&stream
|
||||
&end POP2r #0a18 DEO
|
||||
;dict/footer !<pstr>
|
||||
;dict/c !<pstr>
|
||||
|
||||
@<print-name> ( src* -- )
|
||||
scap/ [ LIT "/ ] srew
|
||||
&w ( -- )
|
||||
LDAk [ LIT ". ] EQU ?&end
|
||||
LDAk #18 DEO
|
||||
INC2 LDAk ?&w
|
||||
&end POP2 JMP2r
|
||||
|
||||
(
|
||||
@|stdlib )
|
||||
|
@ -48,6 +58,13 @@
|
|||
#00 JMP2r }
|
||||
POP2 #01 JMP2r
|
||||
|
||||
@srew ( str* char -- )
|
||||
,&t STR
|
||||
&w ( -- )
|
||||
LDAk [ LIT &t $1 ] EQU ?&end
|
||||
#0001 SUB2 LDAk ?&w
|
||||
&end INC2 JMP2r
|
||||
|
||||
@scap ( str* -- end* )
|
||||
&w ( -- )
|
||||
INC2 & LDAk ?&w
|
||||
|
@ -71,6 +88,7 @@
|
|||
INC2 & LDAk ?&w
|
||||
POP2 JMP2r
|
||||
|
||||
@dict &header "unsigned 20 "char 20 "rom[] 20 "= 20 "{ 0a 09 $1
|
||||
&footer "}; 0a 00
|
||||
@dict &a "unsigned 20 "char 20 $1
|
||||
&b "[] 20 "= 20 "{ 0a 09 $1
|
||||
&c "}; 0a 00
|
||||
|
||||
|
|
Loading…
Reference in New Issue