v6502
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: v6502
Hi Marcel,
Pleased to see your interest in VTL02.
I first came across this a few years ago when I found the original paper describing this "Very Tiny Language" which appeared initially in 1976 following the introduction of the Altair computer. It was quite an achievement to squeeze a usable, interpreted language into just 768 bytes of 6800 code.
The language was revisited some 30 years later with VTL-2 - here
http://www.altair680kit.com/manuals/Alt ... chable.pdf
Now that it has been ported to the 6502 and with added features it makes it accessible to the Gigatron, and chronologically correct for a machine inspired by mid-1970s TTL technology.
I'm looking forward to seeing it part of a future ROM offering.
regards
Ken
Pleased to see your interest in VTL02.
I first came across this a few years ago when I found the original paper describing this "Very Tiny Language" which appeared initially in 1976 following the introduction of the Altair computer. It was quite an achievement to squeeze a usable, interpreted language into just 768 bytes of 6800 code.
The language was revisited some 30 years later with VTL-2 - here
http://www.altair680kit.com/manuals/Alt ... chable.pdf
Now that it has been ported to the 6502 and with added features it makes it accessible to the Gigatron, and chronologically correct for a machine inspired by mid-1970s TTL technology.
I'm looking forward to seeing it part of a future ROM offering.
regards
Ken
Re: v6502
Testing has progressed. We can run Microchess now. Video: https://youtu.be/KBdDg5JfVs8
Changes are:
I will push it into GitHub later after I have resolved a number of merge conflicts. Surprisingly, none concern the emulator itself.
Changes are:
- It runs in full
- On true TTL
- Without VGA timing errors
- C - Clear position
- E - Exchange sides
- P - Start thinking and make a move
- Q - Quit into wozmon
I will push it into GitHub later after I have resolved a number of merge conflicts. Surprisingly, none concern the emulator itself.
Re: v6502
Despite summer break, there's still some testing on the v6502 mode that crept through: VTL02 now works and is in GitHub. VTL-2 is a cute tiny interactive programming language that has its origins on the Altair 680. VTL02 is Mike Barry's port of it to the 6502. His port is still under 1K!
It's small yet powerful. Here's a shootout with TinyBASIC in calculating the primes under 1000:
v6502 and TinyBASIC nicely balance out their inefficiencies.
The other realisation I had the other day is that we now effectively have a second C compiler to toy with: cc65. This might be a quicker way to get existing SDcard/FAT C libraries running on the platform.
It's small yet powerful. Here's a shootout with TinyBASIC in calculating the primes under 1000:
Code: Select all
VTL02 on v6502 TinyBASIC on vCPU
-------------- -----------------
10 N=7 10N=7
20 M=4 20M=4
30 D=5 30D=5
40 E=2 40E=2
50 X=N/D 50IFN%D=0GOTO100
55 #=%]100
60 D=D+E 60D=D+E
70 E=6-E 70E=6-E
80 #=N>(D*D)[50 80IFD*D<=NGOTO50
90 ?=" "; 90?" ";N;
95 ?=N
100 N=N+M 100N=N+M
110 M=6-M 110M=6-M
120 #=N<999[30 120IFN<999GOTO30
#=1 RUN
-------------- -----------------
Elapsed: Elapsed:
1m14.9s 1m16.0s
The other realisation I had the other day is that we now effectively have a second C compiler to toy with: cc65. This might be a quicker way to get existing SDcard/FAT C libraries running on the platform.
Re: v6502
Next stage of testing v6502 has to be Micro-Soft BASIC with floating point. We're not quite there yet as it goes awry after the memory check. But by reorganising the video indirection table we can squeeze in the entire 8.3 KB BASIC binary and don't have to compromise too much on screen space. We should get 3584 BASIC bytes free on the stock 32K system.
- Attachments
-
- Screenshot 2019-10-07 at 09.43.33.png (76.41 KiB) Viewed 8221 times
-
- Posts: 20
- Joined: 27 Jun 2018, 18:40
Re: v6502
Very impressive! It's very nice to see a Commodore Basic running on the Gigatron ![Wink ;-)](./images/smilies/icon_e_wink.gif)
![Wink ;-)](./images/smilies/icon_e_wink.gif)
Re: v6502
Apart from Ctrl-C not yet working, it's otherwise stable. With 3583 bytes free it has the same free memory as the VIC-20. This is really a coincidence.
This is the BASIC that Paul Allen and Bill Gates wrote with Monte Davidoff and Ric Weiland, and for which they started Microsoft, or spelled Micro-Soft back then. They licensed it to many microcomputer builders, amongst others to Commodore. The version we have running is an early one for the Commodore PET.
Although the system can interpret 6502 code, there still was work to do: code, buffers, zero page variables and stack needed relocation. But that wasn't the biggest hurdle as Michael Steil's excellent set of reconstructed assembly sources made that relatively painless. The main problem was to create a sufficiently large continuous memory space. Although the Gigatron has 32K of RAM, 19KB of that is used for screen memory and the remainder is heavily fragmented. For example, by default the largest continuous block we have is just 512 bytes. BASIC itself needs 8KB, plus we need some K's for user program and variables. Ouch...
The first win is to disable the sound channels 2 through 4. That creates a continuous block from $200 to $800. For this trick you need ROM v4.
The next step is to compress the video memory. Our resolution is already nothing, but we can always lower it even more! Of the 120 visible pixel lines, every 8th is always empty. At least, as long as we only use capitals, and for a mid-1970s BASIC that's perfectly acceptable. The empty pixel lines can then be shared for all rows of text. That saves 14*256 = 3585 bytes already.
The last trick is to increase the spacing between text lines from 1 to 4. This reduces the text lines from 15 to 11, but yields 4 * 7 * 256 =7,168 bytes.
Of course we then went overboard and added a flashing cursor, we made sure that the WAIT 6502 Easter Egg works, and that there is a π-symbol. The Gigatron doesn't have that in its font, but it does have T and U.... And... the font is stored without horizontal spacing, so there's our glyph:
Good enough for me:
This is the BASIC that Paul Allen and Bill Gates wrote with Monte Davidoff and Ric Weiland, and for which they started Microsoft, or spelled Micro-Soft back then. They licensed it to many microcomputer builders, amongst others to Commodore. The version we have running is an early one for the Commodore PET.
Although the system can interpret 6502 code, there still was work to do: code, buffers, zero page variables and stack needed relocation. But that wasn't the biggest hurdle as Michael Steil's excellent set of reconstructed assembly sources made that relatively painless. The main problem was to create a sufficiently large continuous memory space. Although the Gigatron has 32K of RAM, 19KB of that is used for screen memory and the remainder is heavily fragmented. For example, by default the largest continuous block we have is just 512 bytes. BASIC itself needs 8KB, plus we need some K's for user program and variables. Ouch...
The first win is to disable the sound channels 2 through 4. That creates a continuous block from $200 to $800. For this trick you need ROM v4.
The next step is to compress the video memory. Our resolution is already nothing, but we can always lower it even more! Of the 120 visible pixel lines, every 8th is always empty. At least, as long as we only use capitals, and for a mid-1970s BASIC that's perfectly acceptable. The empty pixel lines can then be shared for all rows of text. That saves 14*256 = 3585 bytes already.
The last trick is to increase the spacing between text lines from 1 to 4. This reduces the text lines from 15 to 11, but yields 4 * 7 * 256 =7,168 bytes.
Of course we then went overboard and added a flashing cursor, we made sure that the WAIT 6502 Easter Egg works, and that there is a π-symbol. The Gigatron doesn't have that in its font, but it does have T and U.... And... the font is stored without horizontal spacing, so there's our glyph:
Code: Select all
R S T pi U
v v v v v
x x x x . . x x x . x x # # # # . . . x
x . . . x x . . . . . . # . . # . . . x
x . . . x x . . . . . . # . . # . . . x
x x x x . . x x x . . . # . . # . . . x
x . x . . . . . . x . . # . . # . . . x
x . . x . . . . . x . . # . . # . . . x
x . . . x x x x x . . . # . . . # x x .
0 1 2 3 4 5 6 7 8 9 a b c d e f 1 1 1 1
^ 0 1 2 3
font82up
- Attachments
-
- Screenshot 2019-10-16 at 21.28.41.png (33.44 KiB) Viewed 8116 times