Browse code

(asma) Remove LIT merging optimisation.

Andrew Alderwick authored on 19/10/2022 11:22:35
Showing 1 changed files
... ...
@@ -225,7 +225,6 @@
225 225
 	;asma-read-buffer DUP2 ;asma-read-buffer/end ROT2 SUB2 ( func* line^ filename* buf* size^ )
226 226
 	ROT2 ( func* line^ buf* size^ filename* )
227 227
 	,file-read-chunks JSR
228
-	;asma-flush-lit JSR2
229 228
 
230 229
 	asma-IF-ERROR ,&error JCN
231 230
 
... ...
@@ -351,7 +350,7 @@
351 350
 @asma [
352 351
 	&pass $1 &state $1 &line $2 &lines $2 &break $1 &eof $1
353 352
 	&comment-level $1
354
-	&token $2 &orig-token $2 &lit $1 &lit-present $1
353
+	&token $2 &orig-token $2
355 354
 	&addr $2 &written-addr $2 &flush-fn $2
356 355
 	&src-filename $2 &dest-filename $2
357 356
 	&error $2 &log-level $1
... ...
@@ -515,15 +514,8 @@
515 514
 	JMP2r
516 515
 
517 516
 @asma-write-lit ( byte -- )
518
-	;asma/lit LDA2 ,&present JCN
519
-	POP #01 ;asma/lit STA2
520
-	#0002 ,asma-advance-addr JMP ( tail call )
521
-	&present
522
-	#fffe ,asma-advance-addr JSR
523
-	LIT LIT2 ,asma-write-byte/raw JSR
524
-	,asma-write-byte/raw JSR
525
-	,asma-write-byte/raw JSR
526
-	#0000 ;asma/lit STA2
517
+	LIT LIT ,asma-write-byte JSR
518
+	,asma-write-byte JSR
527 519
 	JMP2r
528 520
 
529 521
 @asma-advance-addr ( delta* -- )
... ...
@@ -532,24 +524,12 @@
532 524
 	SWP2 STA2
533 525
 	JMP2r
534 526
 
535
-@asma-flush-lit ( -- )
536
-	;asma/lit LDA2 ,&present JCN
537
-	POP JMP2r
538
-	&present
539
-	#fffe ,asma-advance-addr JSR
540
-	LIT LIT ,asma-write-byte/raw JSR
541
-	,asma-write-byte/raw JSR
542
-	#0000 ;asma/lit STA2
543
-	JMP2r
544
-
545 527
 @asma-write-short ( short -- )
546 528
 	SWP
547 529
 	,asma-write-byte JSR
548 530
 	( fall through )
549 531
 
550 532
 @asma-write-byte ( byte -- )
551
-	,asma-flush-lit JSR
552
-	&raw
553 533
 	;asma/addr LDA2 ;asma/written-addr LDA2
554 534
 	LTH2k ,&rewound JCN
555 535
 	&loop
... ...
@@ -667,7 +647,6 @@
667 647
 	JMP2r
668 648
 
669 649
 @asma-label-define
670
-	;asma-flush-lit JSR2
671 650
 	;asma-trees/labels ,asma-label-helper JSR
672 651
 	,&already-existed JCN
673 652
 
... ...
@@ -678,7 +657,6 @@
678 657
 	JMP2r
679 658
 
680 659
 @asma-sublabel-define
681
-	;asma-flush-lit JSR2
682 660
 	;asma-trees/scope LDA2 ,asma-label-helper JSR
683 661
 	POP POP2
684 662
 	JMP2r
... ...
@@ -708,15 +686,10 @@
708 686
 	#00 JMP2r
709 687
 
710 688
 @asma-pad-absolute
711
-	;asma-flush-lit JSR2
712 689
 	#0000 ;asma/addr STA2
713
-	,asma-pad-helper JMP
714
-
715
-@asma-pad-relative
716
-	;asma-flush-lit JSR2
717 690
 	( fall through )
718 691
 
719
-@asma-pad-helper ( -- )
692
+@asma-pad-relative
720 693
 	#00 ;asma-parse-hex-string JSR2
721 694
 	,&valid JCN
722 695
 
... ...
@@ -767,7 +740,7 @@
767 740
 @asma-literal-rel-addr
768 741
 	,asma-addr-helper JSR
769 742
 	;asma/addr LDA2 SUB2
770
-	#0003 ;asma/lit-present LDA SUB SUB2
743
+	#0003 SUB2
771 744
 
772 745
 	DUP2 #0080 LTH2 STH
773 746
 	DUP2 #ff7f GTH2 STHr ORA ,&in-bounds JCN