Skip to content

04.PreviousVersions

Matteo Vitturi edited this page Nov 27, 2023 · 3 revisions

vForth 1.1 and 1.2

http://www.oocities.org/matteo_vitturi
https://www.youtube.com/watch?v=AZ4J0RzFUaI
https://www.youtube.com/watch?v=xbyswbEdFcs

One of the piece of code I wrote in Forth came from the need of a Forth Assembler: after a little Internet search I found Albert van der Horst's work available here. In particular I carefully studied the two Forth sources as80.frt and asgen.frt to get some clue to port his work to be effective within a vintage Sinclair ZX Spectrum system with a ZX-Microdrive. As far I can see, I used an older version than these above. You can recognize asgen.frt in screens between 100 and 119 and as80.frt in screens from 120. At the time I coded it, in the download page a as110.zip file was available, now I see a newer one as4d0.zip as I said.

The task involved here was to modify Albert's "8080 Assembler" to became a "Z80 Assembler" and my first aim was to simply build an assembler, so I ignored the dis-assembler part and to reduce the overall size I also omit wide part of it. What I really did is filling the gap between 8080 and Z80.

I see now that such an unusual Z80 Assembler is one of the more interesting piece of code I wrote in Forth.

So in the !Blocks.bin file you will find the following blocks: Blocks from #101 to #119 builds up the compiler-compiler to prepare the proper ASSEMBLER dictionary.
Blocks from #120 to #139 contain the ASSEMBLER dictionary definitions. At the botton of each block there is one or two line of using example.
Blocks from #140 to #149 contain semantic for IF-THEN-ELSE or BEGIN-UNTIL near-jump structure to make easy coding these structures in Assembler.
Blocks from #150 to #159 are for test and verification.
Blocks from #150 to #165 are for test and verification.

You can code using this Forth-Assembler using the real Z80 instructions but sometime compressing or adding modifiers and arguments to complete the instruction.

For example:

LD  B, C        -->   LD      B'|   C|       ( ' means destination registrer )
ADD A, B        -->   ADDA     B|
LD  (nnnn), HL  -->   LD()HL   nnnn NN,
LD  (BC), A     -->   LD(X)A  BC|            ( X means register pair )
ADD A,n         -->   ADDN     n    N,       ( N means immediate value )
LD  BC, nnnn    -->   LDX     BC|   nnnn NN, 
OUT (p), A      -->   OUTA     n    P,
IN  (C), D      -->   IN(C)   D'|
JP Z aaaa       -->   JPF  ZR| Y|  aaaa AA,  ( F means "flag" jump )
                                             ( ZR| is zero-flag and Y| is true )
EX  DE, HL      -->   EXDEHL
SBC HL, BC      -->   SBCHL   BC|
LDIR            -->   LDIR                
BIT 3, B        -->   BIT      3|   B| 
LD IX, nn       -->   LDX     IX|   nnnn NN,  
LD (IX+d), n    -->   LDN    (IY+ d )|  n  N,                

Using this nice Forth-Assembler I almost succeed to cross-compile my Forth to be able to improve it easily.

vForth 1.3

https://sites.google.com/view/vforth/vforth1-3

This version supports 64-columns display system nicely blending Ron Seniscal's SYS 64 (c) 1983 Artic Computing (http://www.worldofspectrum.org/infoseekid.cgi?id=0008823) where I suggested a way to fix a known-error. I added in screens 87 two new word SYS64 and SYS32 to activate and disactivate Ron's 64 columns display system.

In 2013, i thought that only this version deserved a publication since it had some good library utilities, such as LOCATE to search a a word definition within the cartridge or SEARCH-ALL blocks for generic string search.

Another nice feature is the capability to use an external text code source to be fed via RS-232 interface (WinZ80 or Z80 v.3 can do that) into the Spectrum Emulator. That allowed me to begin to code using external editors, since until then everything had to be coded only using the Emulator and the simpliest line editor available in a Forth system. This editor is always there in Screens 10-19. So, in Summer 2013 then, I re-wrote the entire Forth using a peculiar technique: From BASIC, I OPEN# the channel #3 at the serial-port, so a read/write a channel is opened and I could read from serial-port to LOAD source into vocabulary.

In the latest version i included this feature: if you LOAD from a negative block number this means you want to read from the OPEN# stream with the same number without the sing; e.g. -11 LOAD means LOAD from OPEN# 11 stream.

mdr-cruncher

https://github.com/mattsteeldue/zxmdr

When Marcus Cruz wrote me in May 2015, this version was shelved since many years... but his email really surprised me and restored the will to improve this version. Later, he gave me the suggestion to write an utility to easily manipualte .mdr "Microdrive" that proved very useful to myself and some people around (https://sites.google.com/view/vforth/mdr-cruncher). I wrote it in Perl, my 2nd preferred language after Forth.

vForth 1.4s

https://sites.google.com/view/vforth/vforth1413

The aim here was to recompile the whole thing in Forth. I begun to use more decimal version numbers after 1.4, so I issued 1.41, 1.42, 1.421 and so on... Another step ahead was the will to port the Block system to work with MGT DISCiPLE disk interface and these version were stable enough to deserve a proper site publication: (https://sites.google.com/view/vforth/vforth1413)

This lead me to code the same way for the just delivered ZX Spectrum Next, so the latest version 1.413n - build 20200519 to complete the porting of Block system to the very last version of NEXTZXOS (https://sites.google.com/view/vforth/vforth17-next).