Good news! I just got VTL02 (Mike's version C) working on Daryl's SBC-4 (10MHz W65C816).
I am somewhat surprised that the prime-number shootout code ran in just over 3 seconds.
Thank you, Mike!
Attachment:
temp.png [ 597.36 KiB | Viewed 2066 times ]
Code is here:
repo at Gitlab (no microsoft for me).
Porting notes:
It appears that the main stumbling block to porting is VTL02's zero page usage. As I understand, it needs a solid block of 128 bytes at $80, and the routine called
simple must be matched. Mike has
instructions for relocating zero-page block.
May I suggest making the code slightly more portable:
Code:
BASE = $0
at = BASE+$00 ; {@}* internal pointer / mem byte
; VTL02C standard user variable space
; {A B C .. X Y Z [ \ ] ^ _}
; VTL02C system variable space
space = BASE+$40 ;
bang = BASE+$42 ; {!} return line number
quote = BASE+$44 ; {"} user ml subroutine vector
...
One must still adjust
simple, but it makes the job a little easier, and clearly communicates the need for all the variables to stay together as a block (the labeling led me to think otherwise until I wised up)...
The difference in assembler syntaxes is infuriating. Luckily there was only a handful of replacements for low and high address syntax.
Overall, porting is trivial. It took me a few hours to rediscover that the OS uses top of zero page, tracing weird stack corruption that ensued. It took me longer than it should have to notice that I can't just move the vars in $F0-$FF down arbitrarily (more strange bugs). If I was at the top of my game I could've done this in 10 minutes.