Moving toward an output stream second pass

This commit is contained in:
Devine Lu Linvega 2023-01-19 21:02:11 -08:00
parent 4176f0af33
commit e8760288f1
1 changed files with 13 additions and 5 deletions

View File

@ -108,7 +108,7 @@ JMP2r
@lib
&padabs INC2 get-hex !set-head
&padrel INC2 get-hex !move-head
&padrel INC2 get-hex !write-fill
&toplab INC2 ;scope OVR2 SWP2 scpy !create-label
&sublab INC2 make-sublabel !create-label
&litrel #80 write
@ -130,6 +130,17 @@ JMP2r
(
@|primitives )
@write-fill ( len* -- )
#0000 EQU2k ?&skip
&l
#00 write
INC2 GTH2k ?&l
&skip
POP2 POP2
JMP2r
@write-call ( str* -- )
get-ref LDA2 ;write/head LDA2 INC2 INC2 SUB2
@ -161,9 +172,8 @@ JMP2r
@write ( byte -- )
,&head LDR2 #0100 LTH2 ?&err
[ LIT &skip 01 ] ?&no-write
,&head LDR2 #0100 LTH2 ?&no-write
DUP [ LIT2 &rom $2 ] ,&head LDR2 ADD2 STA
DUP #00 EQU ?&no-write
[ LIT2 &head 0100 ] ;assemble/length STA2
@ -171,7 +181,6 @@ JMP2r
POP
#0001 !move-head
&err POP ;token ;err/zeropage !crash
(
@|helpers )
@ -418,7 +427,6 @@ JMP2r
&limit "Labels-limit $1
&invalid "Invalid $1
&mode "Mode $1
&zeropage "Zero-page $1
@opcodes
"LIT "INC "POP "NIP "SWP "ROT "DUP "OVR