6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Oct 05, 2024 7:53 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Tue May 03, 2016 12:36 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1228
Location: Soddy-Daisy, TN USA
I have an L-Star (https://github.com/jacgoudsmit/L-Star) which is a minimal 65c02 computer. I'm having a blast with this thing but my question really relates to any 65c02 SBC. I only mention L-Star for reference.

Anyway, I'm designing an audio board for the L-Star. I have a 65C22 VIA and an AY-3-8912 connected to it over the expansion header. The VIA is working great. I have some LED's tied to port A and B and I can poke different values to it and see the lights. So all good there.

Next, I was experimenting with the AY sound chip but I'm getting nothing (topic for another discussion).

While I can (and have) compiled some simple ASM programs to test the AY, I actually found it easier to test with good'ole AppleSoft BASIC. I've forgotten how much fun it is to turn on a computer and *immediately* start typing BASIC....ah....

Anyway, after spending a few hours writing some BASIC programs to test my AY, I finally had to give up and loose all of that work when I shut the computer down.

So my long, and *wordy* question is, how can I transfer BASIC programs back/forth from my L-Star computer so that I can save them?

The L-Star is essentially an Apple 1 with 16k RAM and 8K ROM. It has a PIA emulated in software (Propeller mcu). I tried to past lines of text in my terminal emulator but it didn't work.

What would be awesome would be a way to take the programs from my L-Star and save them on my modern PC. That way, I can test around on actual hardware and save my results.

Thanks for any suggestions.

**UPDATE**

One thing I didn't try (but it would probably work) is to copy text from my terminal to my Windows machine. This would be tedious on long programs. But surely there is an easier way....

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 4:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
You're connected on a serial port and using a terminal emulator on a PC to interact? That should support copy and paste, although there might be a need to slow down the paste rate and/or to put in a pause at each end of line. Some terminal emulators can do that for you.

I do a fair bit of interacting with a Beeb in exactly this way. I have a basic program which dimly understands srecord format so I can paste machine code in srecord form.

If you had a data transfer protocol program like kermit or xmodem or zmodem (?) on the 6502 side, and if your terminal emulator can use that protocol (some can) then that's a quick and reliable way to move bulk data.

There are other ways too: Tube over serial, but that's a bit esoteric for a non-Acorn machine.

Also, it's common to make an SDcard interface, for solid state storage.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 4:14 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
I suspect that for BASIC source, the "other side" will not have any problems with keeping up, but your SBC may have trouble reading, tokenizing and storing your program as it is being read in. Some old(er) BASICs had a statement "NULLS" for specifying a number of NUL characters to output after each line. This mechanism would mainly be used when outputting to slow printers (that would require some time to execute carriage return / line feed), but it could also be used when sending BASIC source code to a storage device and reading it back again. The NUL characters would be preserved by the storage device, and ignored when reading back the program.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 5:45 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1228
Location: Soddy-Daisy, TN USA
Thanks for the suggestions. I will look into my terminal program too. I didn't really tweak it any and perhaps there are some settings there.

I don't plan on creating large BASIC programs.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 7:12 pm 
Offline

Joined: Thu Mar 10, 2016 4:33 am
Posts: 180
If your AppleSoft Basic has the tape routines in place then this is another option. You may need to add some hardware but the tape port is very simple. Once you have that you can use a sound card or even a phone to record and play back the basic code.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 7:14 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1228
Location: Soddy-Daisy, TN USA
You know, I actually thought about doing that just for grins and giggles.

I even have an old tape drive (I think it's Atari) that I could use for that authentic feel. Reminds me of how I typed half a day on my old TI and saved to tape. Then, accidentally overwriting it with something else. I thought it would "merge". LOL

Those were the days.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 03, 2016 9:55 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
You can also see if you can simply crank the baud rate down (300, 1200) and paste via that. Your programs probably aren't that long to begin with to where this is a big deal. Most tape interfaces are around 1500 anyway.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 04, 2016 3:55 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Just a thought - are you sure your line ending convention from your terminal is matching what the 6502 system expects to see? If it's not seeing line ends, then it's seeing one very long line, and there might be room for only so much before the line starts overwriting something important.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 04, 2016 10:54 pm 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
cbmeeks wrote:
Anyway, after spending a few hours writing some BASIC programs to test my AY, I finally had to give up and loose all of that work when I shut the computer down.


I believe the usual "convention" with BASIC programs on the Apple 1 is to reset the 6502, and then use Woz Mon to save the memory where the program is stored. A bit more information is here.

Obviously the L-Star doesn't have a cassette interface so you can't use those instructions literally. But instead of running the apple cassette interface (ACI) code at C100, you can use Woz mon to dump the BASIC memory to the terminal. By default (as the article linked above, says) the BASIC interpreter uses $0800 to $0FFF to store BASIC programs, and you also need some housekeeping data from the zero page, so you can use a command like 004A.00FF 0800.0FFF in Woz Mon to dump all the data of the entire BASIC memory block.

Before you hit Enter on the command, you use the terminal emulator to start writing everything that's received from the serial port to a file. On TeraTerm you do this with the File>Log command. This asks for a file name and then opens a separate window (that it minimizes to the task bar) where you can see how many bytes have been written. Then you hit Enter on the terminal to execute the Woz Mon command. When the dump is done, you hit the button in the log window to stop logging, and your file contains the exact data that was shown on the terminal screen, no need for copy/paste and stuff.

When you want to load the data back into the L-Star's memory, you simply make sure that the L-Star is in the Woz monitor, and you send the log file to it. Woz Mon will interpret the data as commands, and will store the data back into memory the way it was. Then, you do a warm start of BASIC by entering E2B3R in Woz mon (if you do a cold start using E000R, your program will get erased instantly).

Obviously it's not very efficient to dump the entire memory if your BASIC program is short. There is probably a way to find out where the end of the BASIC program is; the BASIC interpreter probably keeps track of this somewhere in the zero page. Once you know where the last byte is, you can adapt the above command accordingly. Unfortunately I don't know at this time where to find that information. Maybe you can find some more information about Apple 1 integer BASIC that will tell you where to find that information.

For those reading along: you may wonder why you can't simply log the output of a LIST command while BASIC is running (this is what you would do on other early computers with BASIC interpreters such as Microsoft Basic, which were intended to be used with Teletypes that had punch tape readers and writers). The reason is that the LIST command in integer BASIC formats the output to look nice on a video terminal, not for a Teletype with a paper tape punch. It indents the lines and inserts spaces between the keywords. Also, it inserts line breaks to prevent breaking up keywords. All those inserted spaces and line breaks make it impossible to save the output of a LIST and use it as input for the interpreter later.

===Jac

EDIT: Even more information is at http://jefftranter.blogspot.com/2012/03 ... grams.html


Top
 Profile  
Reply with quote  
PostPosted: Thu May 05, 2016 3:12 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1383
I've been using ExtraPutty as a terminal to connect to my 65C02 machine. ExtraPutty supports Xmodem-CRC for send/receive. I wrote an Xmodem loader for my Monitor so I can easily and quickly transfer any type of data to the machine. I later extended it to auto-magically sense S-Records (S19) as created by the WDC Tools package. The single loader function (via the console port) allows text data, binary data and S-record format transfers. Basic code shouldn't be an issue.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: WCMiller and 15 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: