P2Si65 - A Path for P2 to Software, Multitasking, OS, …? - Work in Progress
Based on a P2 a Self-Hosted Computer might be built.
It should have:
A File System (SD Card)
Multitasking to control something or take measurements
A console user interface
Access over WLAN
Plenty of useful Software
If we look at this list, we can see, that Peter Jakacki's Taqoz has nearly all of it. Access over WLAN can be achieved with a ESP-01 Module. Only the last item is not given.
Peter has included a 6502-Simulator in his Source Forge archive.
So the basic idea is:
Have a 6502-Simulator inside Taqoz Forth.
Can we use that to gain access to software?
Old software was often written in assembler to get the speed.
64kBytes of HUB Ram should be plenty for 6502 and still fit nicely into Hub Ram.
Speed must be as fast as an original Computer to be fun: 6502 running at >= 1MHz.
How it went so far
A very first test with the simulator, which is written entirely in Forth, was encouraging. Each assembler code is a Forth word. Very transparent. It worked and it was able to achieve about 0,4MHz with a minimal loop:
$3000 INC $2000
$3003 JMP $3000
Getting rid of debugging code brought it over 1MHz easily. So I decided to go on.
Next part was to bring some little software to it. WOZMON is a famous compact peace of code by Steve Woziak for the Apple I. There is an enhancement, which brings a mnemonic assembler and a disassembler.
So this peace of code brought to light much to learn for me (My experience with 6502 is rather lowlevel as I never owned one of these computers. - …A carry flag, that alters it's meaning…) and some bugs. Console input and output is done via an unused code $FF which is now TaqozTrap. It can be included easily into any assembler code ".byte $FF". I decided to follow: http://www.z80.eu/dos65/DOS-65_System_Interface_Guide_A.pdf
3rd step should bring more test code for debugging and some more knowledge about speed. So I was glad to to stumble over:
https://www.ele.uva.es/~jesus/onthe6502.pdf which gives a benchmark for the "sieve". - This showed a speed back to 0.3MHz. :-( .
Speed was improved over many smaller steps, which made debugging more easy.
Introducing new Methods brought the steps:
Some Hub assembler code
Bring 6502 Registers and constants into cog Ram
Bring assembler routines into LUT Ram
Last step: A self-repeating main loop word in LUT assembler, which does call Forth words.
4th step was now an additional program to find bugs. It is a "Very Tiny Language 2". It is very impressing once again, what can be acieved with less than 1kByte! A IDE with an interpreter.
VTL-2 (altair680kit.com) http://www.altair680kit.com/manuals/Altair_680-VTL-2 Manual-05-Beta_1-Searchable.pdf
Newer Source by Michael T. Barry:
6502-Assembly/VTLC02 at main · barrym95838/6502-Assembly · GitHub
GitHub - Klaus2m5/VTL02: Very Tiny Language for the 6502 series of CPUs
A powerful cross assembler:
cc65 - a freeware C compiler for 6502 based systems: https://cc65.github.io/
The linker/assembler creates a listing file with the hex codes. I wrote a routine, which extracts the hex codes with their addresses and inserts them into the 6502 Hub Ram Page.
Kowalski Simulator, a powerful simulator and debugger:
Daryl's Computer Hobby Page (rictor.org) https://sbc.rictor.org/kowalski.html
This is very helpful to find out, what is going on. (Oh, yes, nearly all bugs are my very own…)
At the moment I am wondering, how to go on, after these steps so far. One attractive possibility seems to be EhBasic.
Enhanced 6502 BASIC – Retro Computing (hansotten.nl): http://retro.hansotten.nl/6502-sbc/lee-davison-web-site/enhanced-6502-basic/
Another possibility seems to be a part - emulation of the BBC computer, because this seems to have a clear interface to some sort of BIOS. It's BASIC is powerful and structured.
What would be the best route to make much software (I am not much of a gamer....) accessible for P2?
Any hints appreciated!