• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Deriving a new dialect of Very Tiny Language from VTL-2 6800 version


Commit MetaInfo

Revisiond061fffd61d9e27f8c9f3d459a1e6e1a3871daef (tree)
Time2022-09-25 21:45:57
AuthorJoel Matthew Rees <joel.rees@gmai...>
CommiterJoel Matthew Rees

Log Message

Moved DP to avoid conflicts (this is the one that had functional expressions)

Change Summary

Incremental Difference

--- a/VTL_6809_coco_translit.asm
+++ b/VTL_6809_coco_translit.asm
@@ -33,7 +33,9 @@ BREAK EQU $03
3333 *ACIACS EQU $FCF4 ; exorcisor
3434 *ACIADA EQU $FCF5 ; exorcisor
3535 *
36-* A few interpreter variables in the direct page won't hurt.
36+* A few interpreter variables in the direct page won't hurt, said the snake oil vendor.
37+* (See SNDDUR and PLYTMR in particular.)
38+* (Really need to move these. Use DP after all? IRQ, at least, uses extended mode addressing.)
3739 * (Yes, I can hear voices of complaint that it's not as "tight" as it could be.)
3840 * (This allows us to save more ROM space and uses DP that would otherwise go wasted.)
3941 * (Trade-offs.)
@@ -47,7 +49,7 @@ BREAK EQU $03
4749 * Does not really make specific use of the DP register.
4850 * ORG $C0 ; Move this according to your environment's needs.
4951 * Change this to move the registers:
50-DPBASE EQU $D0 ; PIA mask at $C2? Avoid it, anyway.
52+DPBASE EQU $C4 ; PIA mask at $C2? Avoid it, anyway.
5153 * PARSET RMB 2 ; Instead of SAVE0 in TERM/NXTRM
5254 PARSET EQU DPBASE+2
5355 * CVTSUM RMB 2 ; Instead of SAVE1 in CBLOOP
@@ -79,6 +81,9 @@ DST EQU SRC+2
7981 STKMRK EQU DST+2 ; to restore the stack on each pass.
8082 DPALLOC EQU STKMRK+2 ; total storage declared in the direct page
8183 *
84+*******!!!!!! Check that we have avoided $00E2, as well, since it is used as PLYTMR by an interrupt routine.
85+* Also, $008D is used as SNDDUR by BASIC.
86+*
8287 * SET ASIDE FOUR BYTES FOR USER
8388 * DEFINED INTERUPT ROUTINE IF NEEDED
8489 ZERO EQU $1600 ; Dodge BASIC and video use RAM.
@@ -180,35 +185,42 @@ PROBE STA 0,X
180185 CMPB 0,X
181186 BNE NOTRAM ; all bits seem to be R/W.
182187 LEAX 1,X
183- STX $400 ; DBG
184188 PROBET CMPX #COLD
185189 BLO PROBE ; CMPX on 6809 works right.
186190 NOTRAM LEAX -1,X
187191 STX STAR
188- STX $402 ; DBG
192+* STX $402 ; DBG
189193 START
194+ STX $400 ; DBG
190195 * LDS #STACK ; re-initialize at beginning of each evaluate
191196 LDS STKMRK ; from mark instead of constant
192197 STS SEMI ; DBG Comment this out when we no longer need to see the stack pointer BASIC gives us.
193198 CLRA ; NUL delimiter
194199 LDX #OKM
195- STX $404 ; DBG
200+* STX $404 ; DBG
196201 LBSR STRING
197- BRA * ; DBG
202+* BRA * ; DBG
198203 *
199204 LOOP CLRA
200205 STA DOLR
201206 STA DOLR+1
202- JSR CVTLN
207+ INC $40D ; DBG
208+ STA $420 ; DBG
209+ LBSR CVTLN
210+ INC $40E ; DBG
211+ STA $421 ; DBG
203212 BCC STMNT ; NO LINE# THEN EXEC
204213 BSR EXEC
205214 BEQ START
206215 *
207216 LOOP2 BSR FIND ; FIND LINE
208217 EQSTRT BEQ START ; IF END THEN STOP
218+ DEC $42A ; DBG
209219 LDX 0,X ; LOAD REAL LINE #
220+ STX $42B ; DBG
210221 STX DOLR ; SAVE IT
211222 LDX SAVLIN ; GET LINE
223+ STX $42D ; DBG
212224 LEAX 3,X ; BUMP PAST LINE # and SPACE
213225 BSR EXEC ; EXECUTE IT
214226 BEQ LOOP3 ; IF ZERO, CONTINUE
@@ -264,23 +276,29 @@ LOOKAG LEAX 1,X ; FIND END OF LINE
264276 RTS
265277 *
266278 FIND LDX #PRGM ; FIND LINE
279+ DEC $425 ; DBG
267280 FND2 STX SAVLIN
268281 CMPX AMPR
269282 BEQ RTS1
283+ DEC $426 ; DBG
270284 * LDA 1,X ; almost missed this.
271285 * SUBA DOLR+1 ; This was necessary because no SUBD
272286 * LDA 0,X ; and CPX does not affect C flag on 6800
273287 * SBCA DOLR
274-* PSHB ; B does not seem to be in use.
288+* PSHS B ; B does not seem to be in use.
275289 LDD 0,X ; Use D because we think we want to keep X.
276290 SUBD DOLR
277-* PULB
291+* PULS B
278292 BCC SET
293+ DEC $427 ; DBG
279294 FND3 BSR NXTXT
295+ DEC $428 ; DBG
280296 BRA FND2
281297 *
282298 SET LDA #$FF ; SET NOT EQUAL
283-RTS1 RTS
299+RTS1
300+ CLR $429 ; DBG (Z FLAG SET)
301+ RTS
284302 *
285303 EVALU LBSR EVAL ; EVALUATE LINE
286304 PSHS A,B ; A is pushed after B
@@ -307,8 +325,11 @@ AR2RND ADDB QUITE ; RANDOMIZER ; Adding the low byte to the high byte
307325 STD QUITE
308326 RTS
309327 *
310-SKP2 BSR FIND ; FIND LINE
328+SKP2
329+ DEC $422 ; DBG
330+ BSR FIND ; FIND LINE
311331 BEQ INSRT ; IF NOT THERE
332+ DEC $423 ; DBG
312333 LDX 0,X ; THEN INSERT
313334 CMPX DOLR ; NEW LINE
314335 BNE INSRT
@@ -337,7 +358,10 @@ DELT LDX SRC
337358 FITIT LDX DST
338359 STX AMPR ; STORE NEW END
339360 *
340-INSRT LDX EDTLIN ; COUNT NEW LINE LENGTH
361+INSRT
362+ INC $423 ; DBG
363+ LDX EDTLIN ; COUNT NEW LINE LENGTH
364+ STX $430 ; DBG
341365 LDB #$03
342366 TST 0,X
343367 BEQ GOTIT ; IF NO LINE THEN STOP
@@ -345,19 +369,21 @@ CNTLN INCB ; count bytes
345369 LEAX 1,X
346370 TST 0,X ; Find trailing NUL
347371 BNE CNTLN
372+ STX $432 ; DBG
373+ STB $434 ; DBG
348374 *
349375 OPEN CLRA ; CALCULATE NEW END
350376 ADDD AMPR
351377 STD INSPTR
378+ STD $437 ; DBG
352379 SUBD STAR
353380 LBCC START ; IF TOO BIG THEN STOP
354381 LDX AMPR
355-* LDS INSPTR ; remember that the 6800/6801 stack is postdecrement push.
382+ STX $435
383+* LDS INSPTR ; Remember that the 6800/6801 stack is postdecrement push.
356384 * STS AMPR
357- LDD INSPTR ; remember that the 6800/6801 stack is postdecrement push.
385+ LDD INSPTR ; The 6809 stack is predecrement push, but that doesn't matter here.
358386 STD AMPR
359-*
360-* LDS AMPR
361387 STD DST
362388 LEAX 1,X ; SLIDE OPEN GAP
363389 SLIDE LEAX -1,X ; going down
@@ -374,13 +400,16 @@ SLIDE LEAX -1,X ; going down
374400 *
375401 * DON LDS DOLR ; STORE LINE #
376402 * STS 0,X
377-DON LDD DOLR ; STORE LINE #
378- STD 0,X
379- STX DST ; will skip by offset store
403+DON
404+ STX $439 ; DBG
405+ LDD DOLR ; STORE LINE #
406+ STD 0,X ; Note MSB1st byte order implicit dependency here.
407+ STX DST ; will skip by offset on store
380408 * LDS EDTLIN ; GET NEW LINE
381409 * DES ; pre-increment
382410 LDD EDTLIN ; GET NEW LINE
383411 STD SRC
412+ STD $43B ; DBG
384413 *
385414 *MOVL INX ; INSERT NEW LINE (skip over LINE # hi byte)
386415 * PULB
@@ -396,7 +425,10 @@ MOVL LDX SRC
396425 *
397426 GOTIT
398427 * LDS #STACK ; Ready for a new line of input.
428+ STS $41C ; DBG
399429 LDS STKMRK ; restore from mark
430+ STS $41E ; DBG
431+ STX $43D ; DBG
400432 LBRA LOOP
401433 *
402434 * RSTRT LBRA START ; warm start over
@@ -433,27 +465,27 @@ ZRSUP LEAX 1,X
433465 *
434466 PNTMSG CLRA ; ZERO FOR DELIM
435467 STRTMS STA DELIM ; STORE DELIMTER
436- DEC $408 ; DBG
468+* DEC $408 ; DBG
437469 *
438470 OUTMSG LDB ,X+ ; GENERAL PURPOSE PRINT
439- INC $409 ; DBG
440- STB $40A ; DBG
471+* INC $409 ; DBG
472+* STB $40A ; DBG
441473 CMPB DELIM
442474 BEQ CTLC
443475 LBSR OUTCH
444- STB $40C ; DBG
476+* STB $40C ; DBG
445477 BRA OUTMSG
446478 *
447479 CTLC
448- INC $420 ; DBG
480+* INC $420 ; DBG
449481 LBSR POLCAT ; POL FOR CHARACTER
450- INC $421 ; DBG
482+* INC $421 ; DBG
451483 BCC RTS2 ; return wherever we came from
452- INC $422 ; DBG
453- STB $423 ; DBG
484+* INC $422 ; DBG
485+* STB $423 ; DBG
454486 LBSR INCH
455487 CMPB #BREAK ; BREAK KEY?
456- STB $424 ; DBG
488+* STB $424 ; DBG
457489 LBEQ START
458490 *
459491 INCH2 LBRA INCH
@@ -747,7 +779,7 @@ INCH BSR POLCAT
747779 *
748780 * OUTPUT ONE CHAR
749781 OUTCH PSHS B,A
750- TFR A,B
782+ TFR B,A
751783 JSR [OUTCHV]
752784 * INC $410 ; DBG
753785 * STA &411 ; DBG