Browse code

Added message types for logging or supression

Andrew Alderwick authored on 14/05/2021 20:21:46
Showing 1 changed files
... ...
@@ -9,6 +9,15 @@
9 9
 	;reset JMP2
10 10
 
11 11
 %asma-IF-ERROR { ;asma/error LDA2 ORA }
12
+%asma-LOG { #01 }
13
+(
14
+	#00 first pass output
15
+	#01 second pass output
16
+	#02 current token
17
+	#04 label dump at end
18
+)
19
+%asma-DEO2 { asma-LOG NEQ JMP DEO2k POP POP2 }
20
+%asma-DEO { asma-LOG NEQ JMP DEOk POP2 }
12 21
 
13 22
 @asma-dump-sublabels ( incoming-ptr* -- )
14 23
 	LDA2
... ...
@@ -19,18 +28,18 @@
19 28
 	( left node )
20 29
 	DUP2 ,asma-dump-sublabels JSR
21 30
 	( here )
22
-	#09 .Console/char DEO
31
+	#09 .Console/char #04 asma-DEO
23 32
 	DUP2 #0004 ADD2
24 33
 	&loop
25 34
 	DUP2 #0001 ADD2 SWP2 LDA
26 35
 	DUP #00 EQU ,&end JCN
27
-	.Console/char DEO
36
+	.Console/char #04 asma-DEO
28 37
 	,&loop JMP
29 38
 	&end
30 39
 	POP
31
-	#09 .Console/char DEO
32
-	LDA2 .Console/short DEO2
33
-	#0a .Console/char DEO
40
+	#09 .Console/char #04 asma-DEO
41
+	LDA2 .Console/short #04 asma-DEO2
42
+	#0a .Console/char #04 asma-DEO
34 43
 
35 44
 	( right node )
36 45
 	#0002 ADD2 ,asma-dump-sublabels JSR
... ...
@@ -49,15 +58,15 @@
49 58
 	&loop
50 59
 	DUP2 #0001 ADD2 SWP2 LDA
51 60
 	DUP #00 EQU ,&end JCN
52
-	.Console/char DEO
61
+	.Console/char #04 asma-DEO
53 62
 	,&loop JMP
54 63
 	&end
55 64
 	POP
56
-	#09 .Console/char DEO
57
-	LDA2k .Console/short DEO2
58
-	#0a .Console/char DEO
65
+	#09 .Console/char #04 asma-DEO
66
+	LDA2k .Console/short #04 asma-DEO2
67
+	#0a .Console/char #04 asma-DEO
59 68
 	( subtree )
60
-	#0002 ADD2 ,asma-dump-sublabels JSR
69
+	#0002 ADD2 ;asma-dump-sublabels JSR2
61 70
 
62 71
 	( right node )
63 72
 	#0002 ADD2 ,asma-dump-labels JSR
... ...
@@ -70,9 +79,9 @@
70 79
 	;asma-init-assembler-pass JSR2
71 80
 	;&filename ;asma-assemble-file-pass JSR2
72 81
 	asma-IF-ERROR ,asma-print-error JCN
73
-	;asma-trees/labels ,asma-dump-labels JSR
74
-	;asma/line LDA2 .Console/short DEO2
75
-	;&lines .Console/string DEO2
82
+	;asma-trees/labels ;asma-dump-labels JSR2
83
+	;asma/line LDA2 .Console/short #04 asma-DEO2
84
+	;&lines .Console/string #04 asma-DEO2
76 85
 	#0000 DIV
77 86
 	BRK
78 87
 
... ...
@@ -165,7 +174,8 @@
165 174
 @asma-trees [ &labels $2 &macros $2 &opcodes $2 &scope $2 ]
166 175
 
167 176
 @asma-assemble-token ( string-ptr* -- )
168
-	DUP2 .Console/string DEO2 #0a .Console/char DEO
177
+	DUP2 .Console/string #02 asma-DEO2
178
+	#0a .Console/char #02 asma-DEO
169 179
 	DUP2 ;asma/token STA2
170 180
 	DUP2 ;asma/orig-token STA2
171 181
 	LDAk ,&not-empty JCN
... ...
@@ -313,10 +323,10 @@
313 323
 	JMP2r
314 324
 
315 325
 @asma-write-byte ( byte -- )
316
-	#3e .Console/char DEO
317
-	#20 .Console/char DEO
318
-	.Console/byte DEO ( FIXME actually write! )
319
-	#0a .Console/char DEO
326
+	#3e .Console/char ;asma/pass LDA asma-DEO
327
+	#20 .Console/char ;asma/pass LDA asma-DEO
328
+	.Console/byte ;asma/pass LDA asma-DEO ( FIXME actually write! )
329
+	#0a .Console/char ;asma/pass LDA asma-DEO
320 330
 	;asma/addr LDA2 #0001 ADD2 ;asma/addr STA2
321 331
 	JMP2r
322 332
 
... ...
@@ -349,14 +359,6 @@
349 359
 
350 360
 @asma-traverse-tree ( incoming-ptr* -- binary-ptr* 00 if key found
351 361
                                     OR node-incoming-ptr* 01 if key not found )
352
-	( ;&help-str .Console/string DEO2
353
-	DUP2 .Console/short DEO2
354
-	#20 .Console/char DEO
355
-	;asma/token LDA2 .Console/string DEO2
356
-	#20 .Console/char DEO
357
-	;asma/orig-token LDA2 .Console/string DEO2
358
-	#0a .Console/char DEO )
359
-
360 362
 	&loop ( incoming-ptr* )
361 363
 	LDA2k ORA ,&valid-node JCN
362 364
 	#01 JMP2r