Deriving a new dialect of Very Tiny Language from VTL-2 6800 version
修訂 | b68d967e5cea256a6c148117634016d282c03704 (tree) |
---|---|
時間 | 2022-09-25 19:56:00 |
作者 | Joel Matthew Rees <joel.rees@gmai...> |
Commiter | Joel Matthew Rees |
Went too far too fast
@@ -3,7 +3,7 @@ | ||
3 | 3 | * 9-23-76 |
4 | 4 | * BY GARY SHANNON |
5 | 5 | * & FRANK MCCOY |
6 | -* COPYWRIGHT 1976, THE COMPUTER STORE | |
6 | +* Original version COPYRIGHT 1976, THE COMPUTER STORE | |
7 | 7 | * |
8 | 8 | * Modified 2022 by Joel Rees |
9 | 9 | * |
@@ -56,13 +56,14 @@ RSTKSZ EQU 24 ; 2 bytes per call, room for interrupts | ||
56 | 56 | |
57 | 57 | * DEFINE LOCATIONS IN MONITOR |
58 | 58 | * INCH EQU $FF00 ; per VTL.ASM |
59 | -* INCH EQU $F012 ; exorsim mdos Input byte with echo unless AECHO is set | |
59 | +EINCH EQU $F012 ; exorsim mdos Input byte with echo unless AECHO is set | |
60 | 60 | * INCH EQU $F015 ; exorsim mdos Input char with echo (F012 -> strip bit 7) |
61 | 61 | * POLCAT EQU $FF24 ; from VTL.ASM |
62 | 62 | * POLCAT EQU POLCATROB ; dummy return, assume INCH takes care of things |
63 | 63 | * OUTCH EQU $FF81 ; from VTL.ASM |
64 | -* OUTCH EQU $F018 ; exorsim mdos Output character with NULs | |
64 | +EOUTCH EQU $F018 ; exorsim mdos Output character with NULs | |
65 | 65 | * OUTS EQU $FF82 ; from VTL.ASM |
66 | +EPCRLF EQU $F021 ; Primarily for forced initialization in exorsim. | |
66 | 67 | ******* Want to define these at bottom because of POLCAT, but ... |
67 | 68 | * |
68 | 69 | * FOR SBC6800 |
@@ -167,13 +168,13 @@ USTKINI EQU * | ||
167 | 168 | |
168 | 169 | RSTKLIM RMB RSTKSZ |
169 | 170 | RSTKINI EQU * |
170 | -STACK EQU RSTKINI-1 ; See TSX/TXS function for why. | |
171 | +STACK EQU RSTKINI-1 ; See TSX/TXS op-code for why. | |
171 | 172 | RMB 8 ; buffer zone |
172 | 173 | |
173 | 174 | STALTOP EQU * |
174 | 175 | |
175 | 176 | |
176 | -* Most assemblers are scared of address calculations, | |
177 | +* Most early assemblers are scared of address calculations, | |
177 | 178 | * So do this in your head: |
178 | 179 | * IF STATLIM >= ALLIMIT |
179 | 180 | * ERROR "Move stack allocations higher!" |
@@ -196,15 +197,16 @@ CODE EQU * | ||
196 | 197 | PRGM EQU * ; PROGRAM STARTS HERE |
197 | 198 | * |
198 | 199 | * |
199 | -START LDS #STACK ; S on 6800 is first free byte on stack. | |
200 | - LDX #USTKINI ; U stack will be top byte (last pushed). | |
201 | - STX vUSP | |
200 | + ORG $7800 | |
201 | +COLD LDS #STACK ; S on 6800 is first free byte on stack. | |
202 | + JSR TRMINI | |
202 | 203 | LDX #GLOBASE |
203 | 204 | STX vTASK |
204 | - BRA REALSTART | |
205 | +START | |
206 | + LDS #STACK ; reset the stack | |
207 | + LDX #USTKINI ; U stack will be top byte (last pushed). | |
208 | + STX vUSP | |
205 | 209 | * |
206 | - | |
207 | -REALSTART | |
208 | 210 | CLRA |
209 | 211 | LDX #OKM |
210 | 212 | BSR STRGT |
@@ -667,8 +669,11 @@ INLN6 CMPB #'@ ; CANCEL | ||
667 | 669 | BNE INLN2 |
668 | 670 | NEWLIN BSR CRLF |
669 | 671 | * |
670 | -INLN LDX #2 ; INPUT LINE FROM TERMINAL | |
672 | +INLN LDX vTASK ;#2 ; INPUT LINE FROM TERMINAL | |
673 | + INX | |
674 | +************* | |
671 | 675 | INLN5 DEX |
676 | + CPX | |
672 | 677 | BEQ NEWLIN |
673 | 678 | INLN2 JSR INCH ; INPUT CHARACTER |
674 | 679 | STAB $87,X ; STORE IT |
@@ -683,6 +688,7 @@ INLIN4 CLR $87,X ; CLEAR LAST CHAR | ||
683 | 688 | LDX #LINBUF |
684 | 689 | BRA LF |
685 | 690 | * |
691 | +*CRLF JSR EPCRLF | |
686 | 692 | CRLF LDAB #$0D ; CARR-RET |
687 | 693 | BSR OUTCH2 |
688 | 694 | LF LDAB #$0A ; LINE FEED |
@@ -690,34 +696,38 @@ OUTCH2 JMP OUTCH | ||
690 | 696 | * |
691 | 697 | OKM FCB $0D |
692 | 698 | FCB $0A |
699 | + FCC ' DONE' | |
700 | + FCB $0D | |
701 | + FCB $0A | |
693 | 702 | FCC 'OK' |
694 | 703 | FCB $00 |
695 | 704 | * |
696 | -* RECIVE POLING | |
705 | +TRMINI LDAB #40 | |
706 | +TRMILP JSR EPCRLF | |
707 | + DECB | |
708 | + BNE TRMILP | |
709 | + RTS | |
710 | +* | |
711 | +* RECEIVER POLLING | |
697 | 712 | POLCAT LDAB ACIACS |
698 | 713 | ASRB |
699 | 714 | RTS |
700 | 715 | * |
701 | -* INPUT ONE CHAR INTO A-REGISTER | |
702 | -INCH BSR POLCAT | |
703 | - BCC INCH RECEIVE NOT READY | |
704 | - LDAB ACIADA INPUT CHARACTER | |
705 | - ANDB #$7F RESET PARITY BIT | |
706 | - CMPB #$7F | |
707 | - BEQ INCH IF RUBOUT, GET NEXT CHAR | |
708 | - BSR OUTCH | |
716 | +* INPUT ONE CHAR INTO B ACCUMULATOR | |
717 | +INCH PSHA | |
718 | + JSR EINCH | |
719 | + TAB | |
720 | + PULA | |
709 | 721 | RTS |
710 | 722 | * |
711 | 723 | * OUTPUT ONE CHAR |
712 | -OUTCH PSHB | |
713 | -OUTCH1 BSR POLCAT | |
714 | - ASRB | |
715 | - BCC OUTCH1 | |
716 | - PULB | |
717 | - STAB ACIADA | |
724 | +OUTCH PSHA | |
725 | + TBA | |
726 | + JSR EOUTCH | |
727 | + PULA | |
718 | 728 | RTS |
719 | 729 | * |
720 | - ORG START | |
730 | + ORG COLD | |
721 | 731 | * |
722 | 732 | END |
723 | 733 |