Deriving a new dialect of Very Tiny Language from VTL-2 6800 version
Revision | 0ee453130d83ba00fbac25efff9454790354d7e3 (tree) |
---|---|
Time | 2022-09-25 21:54:30 |
Author | Joel Matthew Rees <joel.rees@gmai...> |
Commiter | Joel Matthew Rees |
removed debugging pokes to screen
@@ -189,38 +189,27 @@ PROBET CMPX #COLD | ||
189 | 189 | BLO PROBE ; CMPX on 6809 works right. |
190 | 190 | NOTRAM LEAX -1,X |
191 | 191 | STX STAR |
192 | -* STX $402 ; DBG | |
193 | 192 | START |
194 | - STX $400 ; DBG | |
195 | 193 | * LDS #STACK ; re-initialize at beginning of each evaluate |
196 | 194 | LDS STKMRK ; from mark instead of constant |
197 | 195 | STS SEMI ; DBG Comment this out when we no longer need to see the stack pointer BASIC gives us. |
198 | 196 | CLRA ; NUL delimiter |
199 | 197 | LDX #OKM |
200 | -* STX $404 ; DBG | |
201 | 198 | LBSR STRING |
202 | -* BRA * ; DBG | |
203 | 199 | * |
204 | 200 | LOOP CLRA |
205 | 201 | STA DOLR |
206 | 202 | STA DOLR+1 |
207 | - INC $40D ; DBG | |
208 | - STA $420 ; DBG | |
209 | 203 | LBSR CVTLN |
210 | - INC $40E ; DBG | |
211 | - STA $421 ; DBG | |
212 | 204 | BCC STMNT ; NO LINE# THEN EXEC |
213 | 205 | BSR EXEC |
214 | 206 | BEQ START |
215 | 207 | * |
216 | 208 | LOOP2 BSR FIND ; FIND LINE |
217 | 209 | EQSTRT BEQ START ; IF END THEN STOP |
218 | - DEC $42A ; DBG | |
219 | 210 | LDX 0,X ; LOAD REAL LINE # |
220 | - STX $42B ; DBG | |
221 | 211 | STX DOLR ; SAVE IT |
222 | 212 | LDX SAVLIN ; GET LINE |
223 | - STX $42D ; DBG | |
224 | 213 | LEAX 3,X ; BUMP PAST LINE # and SPACE |
225 | 214 | BSR EXEC ; EXECUTE IT |
226 | 215 | BEQ LOOP3 ; IF ZERO, CONTINUE |
@@ -276,11 +265,9 @@ LOOKAG LEAX 1,X ; FIND END OF LINE | ||
276 | 265 | RTS |
277 | 266 | * |
278 | 267 | FIND LDX #PRGM ; FIND LINE |
279 | - DEC $425 ; DBG | |
280 | 268 | FND2 STX SAVLIN |
281 | 269 | CMPX AMPR |
282 | 270 | BEQ RTS1 |
283 | - DEC $426 ; DBG | |
284 | 271 | * LDA 1,X ; almost missed this. |
285 | 272 | * SUBA DOLR+1 ; This was necessary because no SUBD |
286 | 273 | * LDA 0,X ; and CPX does not affect C flag on 6800 |
@@ -290,14 +277,11 @@ FND2 STX SAVLIN | ||
290 | 277 | SUBD DOLR |
291 | 278 | * PULS B |
292 | 279 | BCC SET |
293 | - DEC $427 ; DBG | |
294 | 280 | FND3 BSR NXTXT |
295 | - DEC $428 ; DBG | |
296 | 281 | BRA FND2 |
297 | 282 | * |
298 | 283 | SET LDA #$FF ; SET NOT EQUAL |
299 | 284 | RTS1 |
300 | - CLR $429 ; DBG (Z FLAG SET) | |
301 | 285 | RTS |
302 | 286 | * |
303 | 287 | EVALU LBSR EVAL ; EVALUATE LINE |
@@ -326,10 +310,8 @@ AR2RND ADDB QUITE ; RANDOMIZER ; Adding the low byte to the high byte | ||
326 | 310 | RTS |
327 | 311 | * |
328 | 312 | SKP2 |
329 | - DEC $422 ; DBG | |
330 | 313 | BSR FIND ; FIND LINE |
331 | 314 | BEQ INSRT ; IF NOT THERE |
332 | - DEC $423 ; DBG | |
333 | 315 | LDX 0,X ; THEN INSERT |
334 | 316 | CMPX DOLR ; NEW LINE |
335 | 317 | BNE INSRT |
@@ -359,9 +341,7 @@ FITIT LDX DST | ||
359 | 341 | STX AMPR ; STORE NEW END |
360 | 342 | * |
361 | 343 | INSRT |
362 | - INC $423 ; DBG | |
363 | 344 | LDX EDTLIN ; COUNT NEW LINE LENGTH |
364 | - STX $430 ; DBG | |
365 | 345 | LDB #$03 |
366 | 346 | TST 0,X |
367 | 347 | BEQ GOTIT ; IF NO LINE THEN STOP |
@@ -369,17 +349,13 @@ CNTLN INCB ; count bytes | ||
369 | 349 | LEAX 1,X |
370 | 350 | TST 0,X ; Find trailing NUL |
371 | 351 | BNE CNTLN |
372 | - STX $432 ; DBG | |
373 | - STB $434 ; DBG | |
374 | 352 | * |
375 | 353 | OPEN CLRA ; CALCULATE NEW END |
376 | 354 | ADDD AMPR |
377 | 355 | STD INSPTR |
378 | - STD $437 ; DBG | |
379 | 356 | SUBD STAR |
380 | 357 | LBCC START ; IF TOO BIG THEN STOP |
381 | 358 | LDX AMPR |
382 | - STX $435 | |
383 | 359 | * LDS INSPTR ; Remember that the 6800/6801 stack is postdecrement push. |
384 | 360 | * STS AMPR |
385 | 361 | LDD INSPTR ; The 6809 stack is predecrement push, but that doesn't matter here. |
@@ -401,7 +377,6 @@ SLIDE LEAX -1,X ; going down | ||
401 | 377 | * DON LDS DOLR ; STORE LINE # |
402 | 378 | * STS 0,X |
403 | 379 | DON |
404 | - STX $439 ; DBG | |
405 | 380 | LDD DOLR ; STORE LINE # |
406 | 381 | STD 0,X ; Note MSB1st byte order implicit dependency here. |
407 | 382 | STX DST ; will skip by offset on store |
@@ -409,7 +384,6 @@ DON | ||
409 | 384 | * DES ; pre-increment |
410 | 385 | LDD EDTLIN ; GET NEW LINE |
411 | 386 | STD SRC |
412 | - STD $43B ; DBG | |
413 | 387 | * |
414 | 388 | *MOVL INX ; INSERT NEW LINE (skip over LINE # hi byte) |
415 | 389 | * PULB |
@@ -425,10 +399,7 @@ MOVL LDX SRC | ||
425 | 399 | * |
426 | 400 | GOTIT |
427 | 401 | * LDS #STACK ; Ready for a new line of input. |
428 | - STS $41C ; DBG | |
429 | 402 | LDS STKMRK ; restore from mark |
430 | - STS $41E ; DBG | |
431 | - STX $43D ; DBG | |
432 | 403 | LBRA LOOP |
433 | 404 | * |
434 | 405 | * RSTRT LBRA START ; warm start over |
@@ -465,27 +436,18 @@ ZRSUP LEAX 1,X | ||
465 | 436 | * |
466 | 437 | PNTMSG CLRA ; ZERO FOR DELIM |
467 | 438 | STRTMS STA DELIM ; STORE DELIMTER |
468 | -* DEC $408 ; DBG | |
469 | 439 | * |
470 | 440 | OUTMSG LDB ,X+ ; GENERAL PURPOSE PRINT |
471 | -* INC $409 ; DBG | |
472 | -* STB $40A ; DBG | |
473 | 441 | CMPB DELIM |
474 | 442 | BEQ CTLC |
475 | 443 | LBSR OUTCH |
476 | -* STB $40C ; DBG | |
477 | 444 | BRA OUTMSG |
478 | 445 | * |
479 | 446 | CTLC |
480 | -* INC $420 ; DBG | |
481 | 447 | LBSR POLCAT ; POL FOR CHARACTER |
482 | -* INC $421 ; DBG | |
483 | 448 | BCC RTS2 ; return wherever we came from |
484 | -* INC $422 ; DBG | |
485 | -* STB $423 ; DBG | |
486 | 449 | LBSR INCH |
487 | 450 | CMPB #BREAK ; BREAK KEY? |
488 | -* STB $424 ; DBG | |
489 | 451 | LBEQ START |
490 | 452 | * |
491 | 453 | INCH2 LBRA INCH |
@@ -552,9 +514,7 @@ OUTV RTS | ||
552 | 514 | * |
553 | 515 | VAR CMPB #'$ ; OR STRING |
554 | 516 | BNE VAR1 |
555 | -* INC $418 ; DBG | |
556 | 517 | LBSR INCH |
557 | -* STB $419 ; DBG | |
558 | 518 | CLRA |
559 | 519 | LEAX 1,X |
560 | 520 | RTS |
@@ -718,10 +678,7 @@ INLN LDX #ZERO+2 ; INPUT LINE FROM TERMINAL | ||
718 | 678 | INLN5 LEAX -1,X |
719 | 679 | CMPX #ZERO ; Make this explicit to enable variables moved out of DP. |
720 | 680 | BEQ NEWLIN ; (Was implicit zero compare X from DEX, now explicit.) |
721 | -* INC $420 ; DBG | |
722 | 681 | INLN2 LBSR INCH ; INPUT CHARACTER |
723 | -* STB $421 ; DBG | |
724 | -* INC $422 ; DBG | |
725 | 682 | STB BUFOFF-1,X ; STORE IT |
726 | 683 | CMPB #$5F ; BACKSPACE? |
727 | 684 | BEQ INLN5 |
@@ -770,10 +727,7 @@ POLCATR PULS A | ||
770 | 727 | * |
771 | 728 | * INPUT ONE CHAR INTO B ACCUMULATOR |
772 | 729 | INCH BSR POLCAT |
773 | -* INC $400 ; DBG | |
774 | 730 | BCC INCH ; Wait here. |
775 | -* INC $401 ; DBG | |
776 | -* STB $402 ; DBG | |
777 | 731 | BSR OUTCH ; echo |
778 | 732 | RTS |
779 | 733 | * |
@@ -781,8 +735,6 @@ INCH BSR POLCAT | ||
781 | 735 | OUTCH PSHS B,A |
782 | 736 | TFR B,A |
783 | 737 | JSR [OUTCHV] |
784 | -* INC $410 ; DBG | |
785 | -* STA &411 ; DBG | |
786 | 738 | PULS A,B |
787 | 739 | RTS |
788 | 740 | * |