6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 11:05 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CHOCHI binary loader
PostPosted: Tue Sep 17, 2013 3:39 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
When my CHOCHI (http://forum.6502.org/viewtopic.php?f=10&t=2644) boards start up, they contain a binary loader that flashes an LED (to indicate that the system is up) and waits for a binary upload via the serial port. The protocol is very simple:

-A 2-byte load/execution address
-A 2-byte byte count (actual code, excluding this 4-byte header)
-data...

The original loader code was sitting high up in page $FF and used $FFFC/$FFFD to store the load/execute address initially received (I thought I was clever). This worked pretty well, but while trying to port ehBASIC I realized that my arrangement is not very smart.

I like the ability to load right over high RAM and vectors. That means that the loader should not be in page $FF, and it should not use the reset vector to store the load/execute address.

Where to put it? I stuck it into page 0! There is really no need to load anything into page 0, and it's a safe until the code starts executing (at which point it will overwrite it). I shall also move the 2-byte address to a page 0 location. I am a little concerned as I am feeling clever again :wink:

I am doing some final adjustments and tests. I will be posting a bitstream update soon here:
http://apple2.x10.mx/CHOCHI/#Bitstreams

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
 Post subject: Re: CHOCHI binary loader
PostPosted: Tue Sep 17, 2013 4:18 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Another clever solution would be for the loader to write to 64KB free space in external SRAM. When the loader is done, it does some magic memory remapping to expose that 64KB RAM area as the 6502 memory space.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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: