Merge pull request #10 from pzembrod/master

Migrate most of c64/c16.volksforth target compile sources from vforth4_2.d64 to .fth files
This commit is contained in:
Carsten Strotmann 2020-07-12 15:41:58 +00:00 committed by GitHub
commit f1e0dedb17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 3190 additions and 25 deletions

View File

@ -30,11 +30,21 @@ test: test-c64.result test-c16.result
test64: test-c64.result
debug-64: emulator/tcbase.T64 emulator/build-vf.sh \
disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii)
emulator/build-vf.sh vf-c64-main.fth
# Temporary bincmp target while the old and the new binaries are still
# expected to be binary identical.
# Note: There is now 1 byte difference between the
# old c64/c16-volksforth83 and the new c64/c16-vf-reference:
# Byte $1b64 changed from $7c (old) to $dc (new).
# This corresponds to the ." |" string in .name (blk/page $4e).
# Since both represent the same character in PETSCII, namely | ,
# the difference is acceptable, and a new reference binary was set.
bincmp: cbmfiles/c64-vf-latest cbmfiles/c16-vf-latest
cmp cbmfiles/c64-vf-latest cbmfiles/c64-volksforth83
cmp cbmfiles/c16-vf-latest cbmfiles/c16-volksforth83
cmp -b -l cbmfiles/c64-vf-latest tests/c64-vf-reference
cmp -b -l cbmfiles/c16-vf-latest tests/c16-vf-reference
run-devenv: emulator/devenv.T64
emulator/run-in-vice.sh devenv

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -449,12 +449,15 @@ Code cSave ( f t+1 Name Nlen dev--err)
\ *** Block No. 16, Hexblock 10
\ Target compiler loadscr clv14oct87
\ Target compiler loadscr 11jul20pz
\ Idea and first Implementation by ks/bp
\ Implemented on 6502 by ks/bp
\ volksFORTH83-Version by bp/we
Onlyforth hex
: (blk@ blk @ ;
Defer blk@ ' (blk@ is blk@
\needs (16 .( ?! (16 (64 ?! C) quit
Assembler \needs nonrelocate 5 load
Assembler nonrelocate
@ -472,9 +475,6 @@ clear
\ hex 17 20 +thru \ predefinitions
\ *** Block No. 17, Hexblock 11
\ Target header pointers bp27jun85we
@ -785,7 +785,7 @@ Forth definitions
\ *** Block No. 28, Hexblock 1c
\ compiling names into targ. bp27jun85we
\ compiling names into targ. 11jul20pz
: (theader
?thead @ IF 1 ?thead +!

View File

@ -13,9 +13,10 @@ basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")"
source="$1"
target="$2"
rm -f "${basedir}/cbmfiles/${target}"
test -n "$target" && rm -f "${basedir}/cbmfiles/${target}"
keybuf="include ${source}\nsave-target ${target}\ndos s0:notdone\n"
test -z "$target" && keybuf="include ${source}\n"
DISK9=vforth4_2 DISK10=tc38q "${emulatordir}/run-in-vice.sh" \
"tcbase" "${keybuf}"

View File

@ -6,8 +6,9 @@ hex
1 drive
Onlyforth hex
c load \ clear memory and
d e thru \ clr labels .status
\ clear memory and clr labels .status
include vf-tc-prep.fth
\ *** Block No. 9, Hexblock 9

View File

@ -6,8 +6,9 @@ hex
1 drive
Onlyforth hex
c load \ clear memory and
d e thru \ clr labels .status
\ clear memory and clr labels .status
include vf-tc-prep.fth
\ *** Block No. 9, Hexblock 9

View File

@ -6,8 +6,9 @@ hex
1 drive
Onlyforth hex
c load \ clear memory and
d e thru \ clr labels .status
\ clear memory and clr labels .status
include vf-tc-prep.fth
\ *** Block No. 9, Hexblock 9

View File

@ -0,0 +1,82 @@
\ *** Block No. 123, Hexblock 7b
7b fthpage
\ The remainder to do after loading the
\ system-dependent part of the sources.
Host ' Transient 8 + @
Transient Forth Context @ 6 + !
Target
Forth also definitions
(C16 : (64 ) \ jumps belhind C)
(C64 : (16 )
BEGIN name count 0= abort" C) missing"
@ [ Ascii C Ascii ) $100 * + ] Literal
= UNTIL ; immediate
: C) ; immediate
(C16 : (16 ) (C64 : (64 ) ; immediate
: forth-83 ; \ last word in Dictionary
\ *** Block No. 124, Hexblock 7c
7c fthpage
( System dependent Constants bp/ks)
Vocabulary Assembler
Assembler definitions
Transient Assembler
PushA Constant PushA
\ put A sign-extended on stack
Push0A Constant Push0A
\ put A on stack
Push Constant Push
\ MSB in A and LSB on jsr-stack
RP Constant RP
UP Constant UP
SP Constant SP
IP Constant IP
N Constant N
Puta Constant Puta
W Constant W
Setup Constant Setup
Next Constant Next
xyNext Constant xyNext
(2drop Constant Poptwo
(drop Constant Pop
\ *** Block No. 125, Hexblock 7d
7d fthpage
\ System patchup clv06aug87
Forth definitions
(C64 C000 ' limit >body ! 7B00 s0 ! 7F00 r0 ! )
(C16 8000 ' limit >body ! 7700 s0 ! 7b00 r0 ! )
\ (C16+ fd00 ' limit >body !
\ 7B00 s0 ! 7F00 r0 ! )
s0 @ dup s0 2- ! 6 + s0 7 - !
here dp !
Host Tudp @ Target udp !
Host Tvoc-link @ Target voc-link !
Host move-threads
\ Final part of loadscreen
Assembler nonrelocate
.unresolved

View File

@ -2,17 +2,12 @@
include vf-pr-target.fth
Onlyforth
include vf-sys-indep.fth
(C64 $801 ) (C16 $1001 ) dup displace !
$7E $93 thru \ CBM-Interface
(c16+ $94 load ) \ c16init RamIRQ
Target definitions here!
$10 $7D thru
Assembler nonrelocate
.unresolved
include vf-finalize.fth
' .blk is .status

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
\ *** Block No. 12, Hexblock c
\ ramfill 3:
Onlyforth
Code ramfill ( adr n 8b -)
sei 34 # lda 1 sta
3 # lda setup jsr
N 3 + ldx txa N 2+ ora 0<>
?[ N lda 0 # ldy
[[ 0 # cpx 0<>
?[[ [[ N 4 + )Y sta iny 0= ?]
N 5 + inc dex ]]?
N 2+ ldx 0<> ?[
[[ N 4 + )Y sta iny N 2+ cpy CS ?] ]?
]?
36 # lda 1 sta cli
0 # ldx 1 # ldy Next jmp
end-code
$C000 $4000 (16 $300 - C) 0 ramfill
forget ramfill
\ *** Block No. 13, Hexblock d
( Deleting Assembler Labels bp27jun85we)
: delete Assembler name find
IF >name count $1F and
bounds ?DO $1F I c! LOOP
ELSE count type space THEN ;
delete setup delete xyNext
delete Puta delete SP
delete Pop delete Next
delete N delete UP
delete Poptwo delete W
delete IP delete RP
delete Push delete Push0A
delete PushA delete ;c:
forget delete Onlyforth
\ *** Block No. 14, Hexblock e
( Definition for .status 28jun85we)
: status
blk @ ?dup IF
." blk " u.
." here " here u.
." there " there u.
." heap " heap u. cr
THEN ;
' status is .status
variable current-page 0 current-page !
: fthpage ( page# -- )
dup current-page !
." page " u.
." here " here u.
." there " there u.
." heap " heap u. cr ;
: blk-or-page@ ( -- blk#/page# )
blk @ ?dup ?exit
current-page @ ;
' blk-or-page@ is blk@

Binary file not shown.

Binary file not shown.