6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Mar 29, 2024 11:05 am

All times are UTC




Post new topic Reply to topic  [ 123 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next
Author Message
PostPosted: Thu Aug 01, 2013 5:50 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Greetings.

I would like to start by saying that I'm glad that I joined this forum. Lots of nice (and very sharp) members here.

Some incomplete history. As I'm sure many of you know, back in the mid-seventies, personal computers were a bit software-lacking, and many new users were faced with the nuisance of writing their own machine or assembly code, writing their own interpreter, buying one, or pirating one. I personally didn't arrive on the scene until the TRS-80 Model 1, Level 1 came out, with 4k of RAM and a lot more ROM, so I didn't suffer as much as a beginner. Many of the earlier small systems had extremely limited RAM and ROM resources available, making large interpreters rather inconvenient.

Frank McCoy and Gary Shannon wrote an economical interpreter for the 6800 and 8080 called VTL-2, and it gives the user good bang-for-the-buck, by providing a 16-bit unsigned integer interpreter environment, with immediate- and deferred-mode execution, program editing and listing, simple array and random number generator, etc. On the 6800, it does all of this in 768 ROMable bytes! I thought that it was kind of neat, and e-mailed Frank for the info that I would need to translate it to my beloved 6502, which he promptly and kindly provided.

Although I tried, my versions were unable to reach the 768-byte goal ... the NMOS 6502 takes too many additional instructions when working with 16-bit quantities. I _did_ get them both in under 900 bytes, and I have been toying with the idea of translating them to 65c802 and SWEET-16 ... I'm sure that they could give the 6800 a run for the money in code-density, and the 65c802 version would really haul-a$$. My NMOS 6502 versions are already significantly faster, and are interrupt-safe (Frank used the old 6800 trick of employing the hardware stack pointer as an auxiliary pointer during editor moves).

A nicely-written .pdf of Frank's, with sample VTL-2 programs, can be found here, if anyone is curious:

http://www.altair680kit.com/manuals/Alt ... chable.pdf

I have the source-, list-, and monitor hex listings for the Apple 1 and Apple 2, free for the asking, but I am not sure of the best way to share them with the group (too long for a post such as this, IMO). Would anyone like to check them out? They can be easily adapted to pretty much any 6502 assembler and/or machine with minimal effort.

Thanks to all!

[Edit (Dec 6, 2021): In response to a private request, here is a shortcut to the post in this thread containing the source download for version C, the current version at present. The enhancements over the original port are discussed in the preceding posts and summarized briefly in the source comments.]

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Last edited by barrym95838 on Tue Dec 07, 2021 6:50 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 6:35 am 
Offline

Joined: Sat Oct 20, 2012 8:41 pm
Posts: 87
Location: San Diego
barrym95838 wrote:
I personally didn't arrive on the scene until the TRS-80 Model 1

Welcome!
You're right there are a lot of nice and VERY sharp members here.

The TRS-80 Model 1 was my first computer as well. I programmed it in Basic for a while until I discovered Z80 assembly, this is what got me hooked on microprocessors. I started with cassette tape storage and later with a Disk Drive that held something like 140K bytes.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 10:26 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Hi Mike,

welcome to the forum!

What license is applicable? GPL? I am interested because it might be just that easy and small language required in µcontroller projects with limited resources. After all, one doesn't need floating point to drive some relays and LEDs.

The easiest way to make it available to everybody would be uploading it to a post in this forum as a zip file.

cheers, Klaus

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 3:12 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Hi Klaus,

I truly don't know anything about software licenses, but my intention is to make it freely and completely available to anyone who may find it useful. I'm sure that Frank and I would be offended if some jerk like "Michael Hardy from Missouri" replaced our names with his in the comment credits, but I'm sure that I wouldn't take any legal action if that happened (although I can't speak for Frank). I don't know if it would be prudent to add stronger statements to protect myself from liability concerns, if someone wants to use it in a pacemaker or something, and it crashes.

I'm just going to attach it here, and let the community decide if it's useful. My old XP machine is on its last legs, and I'm not proficient at sharing files, so I hope that it works. I expect nothing more than an "Attaboy" for payment. This is a part-time hobby for me, and I do it to make my brain feel good, not for profit.

Take care,

Mike
Attachment:
File comment: (Interpreter, not Compiler ... sheesh)
VTL-Compiler.zip [3.26 MiB]
Downloaded 818 times

Attachment:
vtl02a1b.asm [24.66 KiB]
Downloaded 693 times

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 4:30 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Hi Mike,

thank you very much for uploading your work. Unfortunately I can't open the uploaded zip. I tried 7-zip and the WinXP file explorer. Both say the file is damaged or has an invalid format.

As for the license - I had to learn that one cannot legally modify and redistribute a program if it does not have a license allowing you to do so. At the same time, the license would waive any liability and retain the copyright of the original authors. You can easily find free license texts that suit your intention of making the program freely and completely available.

cheers, Klaus

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 5:17 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
The zip can be opened in WinRAR

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 5:37 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Yes it does open in WinRAR (installed a test version) but contains only another zip with what seems to be the original vtl-program for the z80 as 26 gif copied pages. However the accumulated size of the gifs is only 2.36MB. The outer zip is 3.26MB. So obviously there are files missing.

edit: removed the WinRAR remark. WinRAR was right and there were no files missing. I was partially blind at that very moment. You know, this type of blindness that you aquire by staring at an LCD all day.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Last edited by Klaus2m5 on Fri Aug 02, 2013 8:08 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 8:18 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
I guess not being in the 6800 world, I completely missed ever seeing VTL even being mentioned back in the day. I have never heard of this language until the recent postings about it. Very interesting.

As for licensing it, you would probably be content with BSD 3 Clause license. It lets folks pretty much do anything they want with the code.

The Apache and MIT licenses are very similar in effect as well.

You should license the code. No license is basically that -- no license, allowing no one to do anything with it. And "public domain" is not an international concept.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 11:02 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Doh!! I was in a hurry this morning before work, and mistakenly attached a .ZIP that Frank sent to me last year (I couldn't open it either, and never figured out why). I will read the 3-clause license thingy, add it to the source, and upload the six files here tonight. They will all be in plain ascii. My intent is expressed a few dozen lines down in the .asm file, but I will clean it up a bit more.

Take care,

Mike

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 02, 2013 2:22 am 
Offline

Joined: Tue Nov 18, 2003 8:41 pm
Posts: 250
Klaus2m5 wrote:
Yes it does open in WinRAR (installed a test version) but contains only another zip with what seems to be the original vtl-program for the z80 as 26 gif copied pages. However the accumulated size of the gifs is only 2.36MB. The outer zip is 3.26MB. So obviously there are files missing.

By the way - that WinRAR gives me some of the data without a comment to the fact it has lost some files doesn't make me buy WinRAR in the foreseeable future...


I doubt there's anything missing, it's UUencoded

Give it a .uue extension and winzip will open it.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 02, 2013 7:33 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Okay, I added the disclaimer, re-assembled it, and successfully tested it in AppleWin. I'm only providing the Apple 2 version right now, because the Apple 1 version seems to have developed a bug, and I can't tell right now if its my fault (from the last revision), or the buggy Paste function in the emulator. Enjoy!

BTW, would someone who knows what they're doing mind re-zipping my .zip attachment from above properly for me and PM-ing it to me, please? I get frustrated sometimes, and mentally blocked, and this .zip appears to be my current kryptonite.

Thanks to all.

Mike

Attachment:
vtl02a2b.asm [26.02 KiB]
Downloaded 556 times

Attachment:
VTL02A2.LST.txt [52.85 KiB]
Downloaded 589 times

Attachment:
VTL02A2.OBJ.txt [3 KiB]
Downloaded 485 times

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 02, 2013 8:01 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
barrym95838 wrote:
BTW, would someone who knows what they're doing mind re-zipping my .zip attachment from above properly for me and PM-ing it to me, please?
Done.

Mike, you have a personal message on this forum.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 02, 2013 3:11 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Thanks a million, Klaus!

I remember what it is now. It's a split-octal 8080 list file of a performance modification that Frank devised many years ago.

He deduced that a lot of the interpreter's time was being spent converting ascii numbers to binary and locating branch targets, so he wrote a pseudo-compiler that did most of the work before run-time. Now that I can actually read it, it's possible that I will do a similar experiment on VTL02. It's not going to be easy for me to decipher, since my 8080 assembly skills are quite weak, but few worthwhile things in life are easy, right? At least the 8080 is little-endian, like all good microprocessors should be [flame suit on].

Mike

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 04, 2013 1:45 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
A little feedback on my VTL02 adventure:

I managed to convert the source to the AS65 assembler. The required changes were mostly marking comments as such, changing directives and some expressions. Of course I could just have used the assembler recommended for VTL. However, I have setup propper syntax highlighting in the editor I am using and that would not have worked with the recommended assembler.

After that it was just a matter of changing the standard input and output subroutines to load/store their data to/from an ACIA data register. One more change needed to the Print routine as it can be paused/resumed by any input from the terminal.

It is amazing how small the interpreter is and how much functionallity you get. Well done Mike!

It has a very simple syntax ((line number) variable = expression), so that it is feasible not to check for syntax errors. When you get it wrong, the result is not valid. No line number is direct mode. The line number must be followed by a blank space. Only one statement is allowed per line.

All variables are 1 character. Some have a special meaning to allow I/O (?, $), control program flow (#, !), call a machine language subroutine (>, "), control memory usage (&, *) and more. Since they always are just one character (except when entering an immediate decimal number, parenthesis or indirect pointer to array memory) the next character must be an operator. The first operator is always = Further operators inside the expression can be +-*/<=> The evaluation order is always left to right except when using parenthesis. Space is a valid variable, so filling blanks are not allowed.

It seems very simple to apply changes and additions. For use in a microcontroller environment I will add logical operators &|^ , hex and binary number prefix, I/O of hex and binary numbers, peek and poke.

VTL02 already has a special version of deek and doke with offset to the end of program which it calls a variable array. However, that will be to complicated to use when you only want to handle a single byte anywhere in the address space. It seems odd that logical operators are not implemented but of course they only make sense in conjunction with binary or hex numbers.

I was looking for a tool to allow ad hock fixes to finished projects without having to change the whole project. I think VTL02 gives me this option without using up too much space. For this purpose I may even convert VTL02 to AVR assembler in the future.

Thank you very much Mike!

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 04, 2013 3:30 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
You just made my day, Klaus! I thought about converting the source to a more popular assembler, but San's DOS-based cross-assembler serves my needs well, and I didn't want to slight his indirect contribution to my little project. Please feel free to share your as65 version with us here, since your effort should make it more accessible to the rest of the group, and that was my original intent.

By the way, my test-suite that I use for verification is an incomplete translation of the old Super Star Trek game, from the early 70s. I still need to debug the fixed point routines for navigation and photon torpedo functionality, and the project has stalled there for a while. However, the parts that already work make heavy use of every part of the interpreter, so I know that if I can get through the galaxy initialization and first short-range sensor scan without crashing, then I have thoroughly tested the interpreter! If I ever get it completely finished and de-bugged, I'll share it with the group as well. It needs about 30K in which to run, because it includes full comments, full messages, and complete playing instructions, along with all of the other "super-" extras. My version will run on any 40-column+ ascii display, making it feasible on the Apple 1 and similar display-limited machines.

Take care, and thanks again!

Mike

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 123 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: