Deriving a new dialect of Very Tiny Language from VTL-2 6800 version
Revision | ea551197339ed3098ed96d60da76c78d28e75e75 (tree) |
---|---|
Time | 2022-10-06 15:56:26 |
Author | Joel Matthew Rees <joel.rees@gmai...> |
Commiter | Joel Matthew Rees |
Using Y in decimal conversion, analyzing powers10
@@ -441,12 +441,26 @@ GOTIT | ||
441 | 441 | * |
442 | 442 | * RSTRT LBRA START ; warm start over |
443 | 443 | * |
444 | +PWRS10 FCB $27 ; 10000 | |
445 | + FCB $10 | |
446 | + FCB $03 ; 1000 | |
447 | + FCB $E8 | |
448 | + FCB $00 ; 100 | |
449 | + FCB $64 | |
450 | + FCB $00 ; 10 | |
451 | + FCB $0A | |
452 | + FCB $00 ; 1 | |
453 | + FCB $01 | |
454 | +* | |
444 | 455 | PRNT PULS B ; PRINT DECIMAL |
445 | -PRNT2 LDX #DECBUF ; CONVERT TO DECIMAL ** fix this reference later | |
456 | +PRNT2 LDX #DECBUF ; CONVERT TO DECIMAL ** fix local variables later | |
446 | 457 | STX CNVPTR |
447 | - LDX #PWRS10 | |
448 | -CVD1 PSHS X | |
449 | - LDX 0,X | |
458 | +* LDX #PWRS10 | |
459 | + LEAY PWRS10,PCR | |
460 | +*CVD1 PSHS X | |
461 | +* LDX 0,X | |
462 | +CVD1 | |
463 | + LDX 0,Y | |
450 | 464 | STX VARADR |
451 | 465 | LDX #VARADR |
452 | 466 | LBSR DIVIDE |
@@ -458,9 +472,11 @@ CVD1 PSHS X | ||
458 | 472 | PULS A |
459 | 473 | LEAX 1,X |
460 | 474 | STX CNVPTR |
461 | - PULS X | |
462 | - LEAX 2,X | |
463 | - TST 1,X | |
475 | +* PULS X | |
476 | +* LEAX 2,X | |
477 | +* TST 1,X ; What is this stopping on? | |
478 | + LEAY 2,Y | |
479 | + TST 1,Y ; What is this stopping on? | |
464 | 480 | BNE CVD1 |
465 | 481 | * |
466 | 482 | LDX #DECB_1 |
@@ -632,16 +648,7 @@ EVAL7 BSR SUB2 ; GT TEST | ||
632 | 648 | COMBOUT COMB |
633 | 649 | BRA COMOUT |
634 | 650 | * |
635 | -PWRS10 FCB $27 ; 10000 | |
636 | - FCB $10 | |
637 | - FCB $03 ; 1000 | |
638 | - FCB $E8 | |
639 | - FCB $00 ; 100 | |
640 | - FCB $64 | |
641 | - FCB $00 ; 10 | |
642 | - FCB $0A | |
643 | - FCB $00 ; 1 | |
644 | - FCB $01 | |
651 | +* Move powers of 10 closer to what uses it. | |
645 | 652 | * |
646 | 653 | DIVIDE CLR MLDVCT ; DEVIDE 16-BITS |
647 | 654 | GOT INC MLDVCT |