Browse code

Dealt with source files that don't end with whitespace

Andrew Alderwick authored on 14/05/2021 22:02:41
Showing 1 changed files
... ...
@@ -87,7 +87,7 @@
87 87
 
88 88
 	&filename
89 89
 		( "test.usm 00 )
90
-		"projects/demos/piano.usm 00
90
+		"projects/examples/gui/label.usm 00
91 91
 
92 92
 	&lines [ 20 "lines 20 "in 20 "total. 0a 00 ]
93 93
 
... ...
@@ -110,19 +110,23 @@
110 110
 	&loop
111 111
 	OVR2 .File/name DEO2
112 112
 	DUP2 .File/offset DEO2
113
-	#0100 .File/length DEO2
114
-	#fe00 DUP2k .File/load DEO2
115
-	.File/success DEI2 ORAk ,&not-end JCN
116
-	POP2 POP2
117
-	&error
118
-	POP2 POP2 POP2
119
-	JMP2r
120
-
121
-	&not-end
113
+	#0023 STH2k .File/length DEO2
114
+	#f000 DUP2k .File/load DEO2
115
+	.File/success DEI2
116
+	DUP2 STH2r SUB2 ORA ,&last-one JCN
122 117
 	,asma-assemble-chunk JSR asma-IF-ERROR ,&error JCN
123 118
 	SUB2 SUB2
124 119
 	,&loop JMP
125 120
 
121
+	&last-one
122
+	ADD2k #00 ROT ROT STA
123
+	#0001 ADD2
124
+	,asma-assemble-chunk JSR asma-IF-ERROR ,&error JCN
125
+	POP2
126
+	&error
127
+	POP2 POP2 POP2
128
+	JMP2r
129
+
126 130
 @asma-init-assembler ( -- )
127 131
 	#ff ;asma/pass STA
128 132
 	#0000 ;asma/error STA2