V-FORTH - Forth-83 for the VIC

Basic and Machine Language

Moderator: Moderators

User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

funkheld wrote: Sat Nov 23, 2019 6:34 am can you convert the autosave so that autosave can also be done by vforth.rom.
it is too cumbersome for me to start the vforth from the disk to autosave and then
start vforth.rom again.
That would be quite difficult to do, the read-only part of the dictionary is located from $A000, the rest from $2000. It would have to be saved in two files with a loader to handle the second part.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hello thanks for the information.
Will you manage that??

Thanks & Greetings
User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

What are you looking for? It would be an odd requirement to run a program to need both 8kB RAM in BLK5 and 8kB+ in BLK1 etc. It's more reasonable to say you just need 16kB+ RAM.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Can not you both retrieve one after the other to compile? The foundation is anyway the whole Vforth and then the own file or?
I think a ROM is more advanced than this floppy change.
The compiliren to a prg I think super.

Thank you.
greeting
User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

But a load just writes a sequence of bytes to memory. The ROM image works by having a fixed, small relocatable block that is copied from the end of the image to RAM. That can't work for the autosave because the words exist in RAM already.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.
how can you please resolve this code line that works as asm.
it does not work for me that it works.

Thank you.
greeting

------------------------------------
code shiftre22
a2 c, 0 c, bd c, 0 c, 14 c, 4a c, 7e c, 8 c, 14 c, 7e c, 10 c, 14 c, 7e c,
18 c, 14 c, 7e c, 20 c, 14 c, 7e c, 28 c, 14 c, 7e c, 30 c, 14 c, 7e c, 38 c,
14 c, 7e c, 40 c, 14 c, 7e c, 48 c, 14 c, 7e c, 50 c, 14 c, 7e c, 58 c, 14 c,
7e c, 60 c, 1c, 7e c, 68 c, 14 c, 7e c, 70 c, 14 c, 7e c, 78 c, 14 c, 7e c,
80 c, 14 c, 7e c, 88 c, 14 c, 7e c, 90 c, 14 c, 7e c, 98 c, 14 c, 7e c, a0 c,
14 c, 7e c, a8 c, 14 c, 7e c, 0 c, 14 c, e8 c, e0 c, 8 c, d0 c, b5 c, 4c c, next ,
--------------------------
User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

You are making use of the .X register, this is used by VFORTH for the data stack pointer. You must preserve it at the start of the word with

Code: Select all

xsave stx,  ( 86 c,  4d c, )
and restore it immediately before the jump to NEXT

Code: Select all

xsave ldx,  ( a6 c,  4d c, )
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

hello, thanks for the help.

greeting.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.

that does not work !

Thank you.
greeting

----------------------------------
hex
' lit 1a + constant next

: code create here dup body> ! ; immediate

code shiftre22
86 c, 4d c,
a2 c, 0 c, bd c, 0 c, 14 c, 4a c, 7e c, 8 c, 14 c, 7e c, 10 c, 14 c, 7e c, 18 c,
14 c, 7e c, 20 c, 14 c, 7e c, 28 c, 14 c, 7e c, 30 c, 14 c, 7e c, 38 c, 14 c, 7e c,
40 c, 14 c, 7e c, 48 c, 14 c, 7e c, 50 c, 14 c, 7e c, 58 c, 14 c, 7e c, 60 c, 14 c,
7e c, 68 c, 14 c, 7e c, 70 c, 14 c, 7e c, 78 c, 14 c, 7e c, 80 c, 14 c, 7e c, 88 c,
14 c, 7e c, 90 c, 14 c, 7e c, 98 c, 14 c, 7e c, a0 c, 14 c, 7e c, a8 c, 14 c, 7e c,
0 c, 14 c, e8 c, e0 c, 8 c, d0 c, b5 c,
a6 c, 4d c,
4c c, next ,

------------------------------------
ldx #0
Rightshift
lda $1400,x
lsr
ror $1400+8 ,x
ror $1400+16 ,x
ror $1400+24 ,x
ror $1400+32 ,x
ror $1400+40 ,x
ror $1400+48 ,x
ror $1400+56 ,x
ror $1400+64 ,x
ror $1400+72 ,x
ror $1400+80 ,x
ror $1400+88 ,x
ror $1400+96 ,x
ror $1400+104 ,x
ror $1400+112 ,x
ror $1400+120 ,x
ror $1400+128 ,x
ror $1400+136 ,x
ror $1400+144 ,x
ror $1400+152 ,x
ror $1400+160 ,x
ror $1400+168 ,x
ror $1400,x
inx
cpx #8
bne Rightshift
--------------------------------------
User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

It's now keeping the stack correctly, I can see it rotating the contents of memory but I'm not sure of its function. Can you provide the rest of the code?
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hello, thanks for your help.
Doing more than just turning the asm will work with the vforth. the vforth crashes with it.
can it not digest such an asm? i
I'm concerned that such a program works with the vforth.
Is it possible to call a remote ASM with "CALL"?

Thank you.
greeting

-----------------------------------------------
!to "shiftre22.p", cbm

*=4608

ldx #0
Rightshift
lda $1400,x
lsr
ror $1400+8 ,x
ror $1400+16 ,x
ror $1400+24 ,x
ror $1400+32 ,x
ror $1400+40 ,x
ror $1400+48 ,x
ror $1400+56 ,x
ror $1400+64 ,x
ror $1400+72 ,x
ror $1400+80 ,x
ror $1400+88 ,x
ror $1400+96 ,x
ror $1400+104 ,x
ror $1400+112 ,x
ror $1400+120 ,x
ror $1400+128 ,x
ror $1400+136 ,x
ror $1400+144 ,x
ror $1400+152 ,x
ror $1400+160 ,x
ror $1400+168 ,x
ror $1400,x
inx
cpx #8
bne Rightshift
rts
--------------------------------------------------------
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

hello , good day.

how can you please bring daten.bin to the dsk with vforth?

Thank you.
greeting
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.

can you translate this once with your assembler.fs from vforth

then I can learn from you also from the demo.

Thank you.
greeting


-----------------------------------------------
ldx #0
Rightshift
lda $1400,x
lsr
ror $1400+8 ,x
ror $1400+16 ,x
ror $1400+24 ,x
ror $1400+32 ,x
ror $1400+40 ,x
ror $1400+48 ,x
ror $1400+56 ,x
ror $1400+64 ,x
ror $1400+72 ,x
ror $1400+80 ,x
ror $1400+88 ,x
ror $1400+96 ,x
ror $1400+104 ,x
ror $1400+112 ,x
ror $1400+120 ,x
ror $1400+128 ,x
ror $1400+136 ,x
ror $1400+144 ,x
ror $1400+152 ,x
ror $1400+160 ,x
ror $1400+168 ,x
ror $1400,x
inx
cpx #8
bne Rightshift
rts
--------------------------------------------------------
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.

I try small with the vforth-asm.
but it does not work.

thanks
greeting.

this does not work:
-------------------------
code shiftre
xsave stx,
4608 ldx,
5120 x) ldx,
lsr,
5120 8 + x) ror,
xsave ldx,
next jmp,
end-code
-----------------------
User avatar
srowe
Vic 20 Scientist
Posts: 1358
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

You need

Code: Select all

.a lsr,
The accumulator must be specified before the instruction.
Post Reply