• R/O
  • HTTP
  • SSH
  • HTTPS

fig-forth-6809: コミット

Source code for a fig Forth interpreter/compiler for the M6809.
M6809用の Forth 原語インタープリター・コンパイラーのソースコード。


コミットメタ情報

リビジョン02ea0f0936f7d9c1a09884982449886c023c1297 (tree)
日時2019-02-09 00:47:33
作者Joel Matthew Rees <reiisi@user...>
コミッターJoel Matthew Rees

ログメッセージ

Improved debug stack dump and NEXT version evaluates, does not compile.

変更サマリ

差分

--- a/commands.text
+++ b/commands.text
@@ -3,12 +3,13 @@ imgtool dir coco_jvc_rsdos workfig.dsk
33
44 imgtool del coco_jvc_rsdos workfig.dsk FIG.BIN
55
6-imgtool put coco_jvc_rsdos figauto6809opt.dsk figao09.bin FIGAO09.BIN
6+[imgtool put coco_jvc_rsdos figauto6809opt.dsk figao09.bin FIGAO09.BIN]
77 imgtool put coco_jvc_rsdos workfig.dsk a.out FIG.BIN
88
99
1010 ../../lwtools-4.14/lwasm/lwasm --list=fig-forth-auto6809opt.list fig-forth-auto6809opt.asm
11-../lwtools-4.14/lwasm/lwasm --list=figao.list figao.asm
11+../../lwtools-4.14/lwasm/lwasm --list=fig-forth-auto6809.list fig-forth-auto6809.asm
12+[../lwtools-4.14/lwasm/lwasm --list=figao.list figao.asm]
1213
1314 for name in bif-6809lw/*.ASM ; do echo $name :\\n ; cat $name | tr '\r' '\n' | grep "BACK" ; done
1415
@@ -16,7 +17,9 @@ for name in bif-6809lw/*.ASM ; do echo $name :\\n ; cat $name | tr '\r' '\n' |
1617 xroar-0.34.7/src/xroar -machine coco2bus -bas roms/Color\ Basic\ v1.3\ \(1982\)\(Tandy\).rom -extbas roms/Extended\ Colour\ Basic\ v1.0\ \(1981\)\(Tandy\)/coco.rom -cart rsdos -cart-rom roms/Color\ Computer\ Controller\ \(1982\)\ \(26-3022\).rom -keymap us -kbd-translate
1718
1819
19-git push reiisi@git.osdn.net:/gitroot/fig-forth-6809/fig-forth-6809.git
20+LOADM "FIG.BIN"
21+LOADM"FIG
22+EXEC &H1200
2023
2124
2225 hex
--- a/fig-forth-auto6809.asm
+++ b/fig-forth-auto6809.asm
@@ -427,7 +427,7 @@ DELINT FDB 4 initial carriage return delay
427427 * STABX STA 0,X 16 cycles until 'NEXT'
428428 * STB 1,X
429429 * STABX STD 0,X ; ?? cycles until 'NEXT'
430- BRA NEXT
430+* BRA NEXT
431431 * GETX LDA 0,X 18 cycles until 'NEXT'
432432 * LDB 1,X
433433 * GETX LDD 0,X ?? cycles until 'NEXT'
@@ -466,8 +466,8 @@ NEXT ; IP is Y, push before using, pull before you come back here.
466466 *
467467 * NEXT2 LDX 0,X get W which points to CFA of word to be done
468468 NEXT2 LDX ,Y++ get W which points to CFA of word to be done
469-* BSR DBGNAM
470-* BSR DBGREG
469+ BSR DBGNAM
470+ BSR DBGREG
471471 * But NEXT2 is too much trouble to use with subroutine threading anyway.
472472 * NEXT3 STX W
473473 NEXT3 ; W is X until you use X for something else. (TOS points back here.)
@@ -479,7 +479,7 @@ NEXT3 ; W is X until you use X for something else. (TOS points back here.)
479479 * =
480480 * JMP 0,X
481481
482- JSR [,X] ; Saving the postinc cycles,
482+ JMP [,X] ; Saving the postinc cycles,
483483 * ; but X must be bumped NATWID to the parameters.
484484 * NOP
485485 * JMP TRACE ( an alternate for the above )
@@ -607,7 +607,7 @@ DBGRkl JSR [$A000]
607607 CMPA #$53 ; 'S'
608608 BEQ DBGRdS
609609 CMPA #$49 ; 'I'
610- BNE DBGRrt
610+ LBNE DBGRrt
611611 DBGRin LDD <XTIB
612612 ADDD <XIN
613613 TFR D,Y
@@ -622,6 +622,34 @@ DBGRit DECA
622622 BNE DBGRip
623623 BRA DBGRrt
624624 DBGRdS TFR S,Y
625+ LDD ,Y++
626+ LBSR OUThxA
627+ LDA #$9F
628+ STA ,X+
629+ LBSR OUThxB
630+ LDD ,Y++
631+ LBSR OUThxA
632+ LDA #$9F
633+ STA ,X+
634+ LBSR OUThxB
635+ LDA #$58 ; X
636+ STA ,X+
637+ LDD ,Y++
638+ LBSR OUThxD
639+ LDA #$59 ; Y
640+ STA ,X+
641+ LDD ,Y++
642+ LBSR OUThxD
643+ LDA #$55 ; U
644+ STA ,X+
645+ LDD ,Y++
646+ LBSR OUThxD
647+ LDA #$50 ; PC
648+ STA ,X+
649+ LDD ,Y++
650+ LBSR OUThxD
651+ LDA #$53 ; Stack
652+ STA ,X+
625653 BRA DBGRst
626654 DBGRsp LDD ,Y++
627655 LBSR OUThxD
@@ -641,6 +669,8 @@ DBGRup LDD ,Y++
641669 STB ,X+
642670 DBGRut CMPY <XSPZER
643671 BLO DBGRup
672+ LDB #$FF
673+ STB ,X+
644674 DBGRrt PULS CC,A,B,DP,X,Y,U,PC
645675 DBGRLB FCC 'DPCC PC S U Y X A B '
646676 FDB 0,0
@@ -1445,7 +1475,9 @@ QTERM FDB *+NATWID
14451475 FCB $D2
14461476 FDB QTERM-12
14471477 CR FDB *+NATWID
1448- LBRA PCR ; Nothing really to do here.
1478+* LBSR DBGREG
1479+ LBSR PCR ; Nothing really to do here.
1480+ LBRA NEXT
14491481 * JSR PCR
14501482 * JMP NEXT
14511483 *
@@ -1848,6 +1880,7 @@ SPSTOR FDB *+NATWID
18481880 FDB SPSTOR-6
18491881 RPSTOR FDB *+NATWID
18501882 LDS RINIT,PCR
1883+* LBSR DBGREG
18511884 LBRA NEXT
18521885 * LDX RINIT initialize from rom constant
18531886 * STX RP
@@ -1863,6 +1896,7 @@ RPSTOR FDB *+NATWID
18631896 FCB $D3
18641897 FDB RPSTOR-6
18651898 SEMIS FDB *+NATWID
1899+* LBSR DBGREG
18661900 PULS Y ; saved IP in Y.
18671901 LBRA NEXT
18681902 *
@@ -4276,8 +4310,8 @@ QUIT3 FDB BRAN
42764310 FCB $D4
42774311 FDB QUIT-7
42784312 ABORT FDB DOCOL,SPSTOR,DEC,QSTACK,DRZERO,CR,PDOTQ
4279- FCB 10
4280- FCC "Forth-6809"
4313+ FCB 14
4314+ FCC "fig-Forth-6809"
42814315 FDB FORTH,DEFIN
42824316 FDB QUIT
42834317 * FDB SEMIS never executed
@@ -4293,11 +4327,15 @@ ABORT FDB DOCOL,SPSTOR,DEC,QSTACK,DRZERO,CR,PDOTQ
42934327 COLD FDB *+NATWID
42944328 * Ultimately, we want position indepence,
42954329 * so I'm using PCR where it seems reasonable.
4296-CENT LDS SINIT,PCR ; Get a useable return stack, at least.
4330+CENT LDS RINIT,PCR ; Get a useable return stack, at least.
4331+ LDU SINIT,PCR ; Get a useable parameter stack, too.
42974332 LDA #IUPDP ; This is not relative to PC.
42984333 TFR A,DP ; And a useable direct page, too.
42994334 SETDP IUPDP ; (For good measure.)
43004335 *
4336+* CLR TRACEM ; DBG
4337+* DEC TRACEM ; DBG
4338+* LBSR DBGREG
43014339 * We'll keep this here for the time being.
43024340 * There are better ways to do this, of course.
43034341 * Re-architect, re-architect.
@@ -4307,6 +4345,7 @@ CENT LDS SINIT,PCR ; Get a useable return stack, at least.
43074345 LEAX RAM,PCR ; bottom of stuff to move
43084346 COLD2 LDA ,X+
43094347 STA ,Y+ ; move TASK & FORTH to ram
4348+* LBSR DBGREG
43104349 CMPX <XFENCE
43114350 BNE COLD2
43124351 * Leaves USE and PREV uninitialized.
@@ -4366,6 +4405,7 @@ WENT LDS SINIT,PCR ; Get a useable return stack, at least.
43664405 LEAX FENCIN,PCR ; top of stuff to move
43674406 WARM2 LDD ,--X ; All entries are 16 bit.
43684407 STD ,--Y
4408+* LBSR DBGREG
43694409 CMPX ,S
43704410 BNE WARM2
43714411 LEAS 2,S ; But we'll reset the return stack shortly, anyway.
--- a/fig-forth-auto6809opt.asm
+++ b/fig-forth-auto6809opt.asm
@@ -608,7 +608,7 @@ DBGRkl JSR [$A000]
608608 CMPA #$53 ; 'S'
609609 BEQ DBGRdS
610610 CMPA #$49 ; 'I'
611- BNE DBGRrt
611+ LBNE DBGRrt
612612 DBGRin LDD <XTIB
613613 ADDD <XIN
614614 TFR D,Y
@@ -623,6 +623,34 @@ DBGRit DECA
623623 BNE DBGRip
624624 BRA DBGRrt
625625 DBGRdS TFR S,Y
626+ LDD ,Y++
627+ LBSR OUThxA
628+ LDA #$9F
629+ STA ,X+
630+ LBSR OUThxB
631+ LDD ,Y++
632+ LBSR OUThxA
633+ LDA #$9F
634+ STA ,X+
635+ LBSR OUThxB
636+ LDA #$58 ; X
637+ STA ,X+
638+ LDD ,Y++
639+ LBSR OUThxD
640+ LDA #$59 ; Y
641+ STA ,X+
642+ LDD ,Y++
643+ LBSR OUThxD
644+ LDA #$55 ; U
645+ STA ,X+
646+ LDD ,Y++
647+ LBSR OUThxD
648+ LDA #$50 ; PC
649+ STA ,X+
650+ LDD ,Y++
651+ LBSR OUThxD
652+ LDA #$53 ; Stack
653+ STA ,X+
626654 BRA DBGRst
627655 DBGRsp LDD ,Y++
628656 LBSR OUThxD
@@ -642,6 +670,8 @@ DBGRup LDD ,Y++
642670 STB ,X+
643671 DBGRut CMPY <XSPZER
644672 BLO DBGRup
673+ LDB #$FF
674+ STB ,X+
645675 DBGRrt PULS CC,A,B,DP,X,Y,U,PC
646676 DBGRLB FCC 'DPCC PC S U Y X A B '
647677 FDB 0,0
@@ -4252,8 +4282,8 @@ QUIT3 FDB BRAN
42524282 FCB $D4
42534283 FDB QUIT-7
42544284 ABORT FDB DOCOL,SPSTOR,DEC,QSTACK,DRZERO,CR,PDOTQ
4255- FCB 10
4256- FCC "Forth-6809"
4285+ FCB 19
4286+ FCC "fig-Forth-6809(RTS)"
42574287 FDB FORTH,DEFIN
42584288 FDB QUIT
42594289 * FDB SEMIS never executed
旧リポジトリブラウザで表示