Monday, March 12, 2012

Applesoft Lite in EEPROM


Recently I've been playing with the EEPROM on the Replica 1 Multi I/O board. The other day I built my JMON monitor program to run out of it. It just needed to have the link address changed to $A000. It was nice to see that it worked out of ROM without any code changes.

Today I rebuilt the Applesoft Lite BASIC interpreter to run out of the Multi I/O EEPROM socket. I downloaded the source code and just made some changes to a couple of files.

By default it builds at address $E000 so it can replace the the on-board EPROM and includes the Woz monitor at $FE00. I didn't need to include the Woz monitor so I removed it from the list of objects to link. Here is the diff to the Makefile:

% diff Makefile.orig Makefile
4c4
< OBJS    = applesoft-lite.o io.o cffa1.o wozmon.o
---
> OBJS    = applesoft-lite.o io.o cffa1.o

It needs to be linked starting at address $A000 rather than $E000, so I made these changes to
the file replica1.cfg, as well as removing the Woz monitor code:

% diff replica1.cfg.orig replica1.cfg
2,3c2,3
<       BASROM:         start = $E000, size = $1F00, fill = yes, file = %O;
<       MONROM:         start = $FF00, size = $100, fill = yes, file = %O;
---
>       BASROM:         start = $A000, size = $1FFF, fill = yes, file = %O;
> #     MONROM:         start = $FF00, size = $100, fill = yes, file = %O;
8c8
<       MONITOR:        load = MONROM,  type = ro;
---
> #     MONITOR:        load = MONROM,  type = ro;

With that it built and worked like a charm. I can now load Applesoft Lite at any time with an "A000R" command from the Woz monitor.
Applesoft Lite running from EEPROM
The code builds with the CC65 assembler, which I had installed. There is a handy utility in the version of CC65 which has been patched to support the Replica 1. The bintomon program converts a binary file from the CA65 tools to the format that can be loaded by the Woz monitor over a serial port.

I made an enhanced version of this program that adds a few features. Specifically:

  1. You can optionally get the start address from the binary file (which seems to be the case when building a C program but not when building an assembler program).
  2. You can specify the load address on the command line.
  3. You can optionally specify the run address on the command line (when it differs from the load address)
  4. Support for  standard command line option parsing.
  5. A verbose option that displays information about the file.

The command usage is:

bintomon [-v] [-f] [-l LoadAddress] [-r RunAddress] filename

To generate the download file for Applesoft Lite I used:

bintomon -l 0xa000 applesoft-lite.bin >applesoft-lite.txt

In a future blog posting I will talk more about the CC65 assembler package and how to use the accompanying C compiler with the Replica 1.

3 comments:

Unknown said...

This is a great right-up, Jeff!

I've been following along, and trying to build Applesoft-lite, to run in address $8000 instead of $E000. I used the same exact steps you used to build your $A000 version. It assembles and links ok, but, it will not run in POM1 A1 emulator.

Is there something I am missing to get it to work with that emulator that you're aware of? Does your $A000 version work in the emulator?
Thanks,
Jason

Unknown said...

and by right-up, I mean, write-up! ;-)

Mariam said...



MY NAME IS MARIAM FROM SOUTH AFRICA...I SAW THIS COMMENT ON POSITIVE BLOGS AND I WILL LOVE TO TELL EVERYBODY HOW MY STATUS CHANGES TO NEGATIVE, AND AM NOW A LIVING WITNESS OF IT AND I THINK ITS A SHAME ON ME IF I DON'T SHARE THIS LOVELY STORY WITH OTHER PEOPLE INFECTED WITH THIS DEADLY VIRUS...,HIV HAS BEEN ONGOING IN MY FAMILY... I LOST BOTH PARENTS TO HIV,. AND IT IS SO MUCH PAIN IVE NOT BEEN ABLE TO GET OVER.. AS WE ALL KNOW MEDICALLY THERE IS NO SOLUTION TO IT..AND MEDICATION IS VERY EXPENSIVE..SO SOMEONE INTRODUCED ME TO A NATIVE MEDICAL PRACTITIONER IN AFRICA..I HAD A JOB THERE TO EXECUTE SO I TOOK TIME TO CHECK OUT ON HIM.I SHOWED HIM ALL MY TESTS AND RESULTS.. I WAS ALREADY DIAGNOSED WITH HIV AND IT WAS ALREADY TAKING ITS TOWL ON ME.. I HAD SPENT THOUSANDS OF DOLLARS SO I DECIDED TO TRY HIM OUT...I WAS ON HIS DOSAGE FOR 1 MONTHS. ALTHOUGH I DIDNT BELIEVE IN IT, I WAS JUST TRYING IT OUT OF FRUSTRATION... AND AFTER 2 WEEKS, I WENT FOR NEW TESTS... AND YOU WONT BELIEVE THAT 5 DIFFERENT DOCTORS CONFIRMED IT THAT AM NEGATIVE..IT WAS LIKE A DREAM,,I NEVER BELIEVE AIDS HAS CURE..AM NOW NEGATIVE,,AM A LIVING WITNESS..I DONT KNOW HOW TO THANK THIS MAN... I JUST WANT TO HELP OTHERS IN ANY WAY I CAN..HAVE JOINED MANY FORUMS AND HAVE POSTED THIS TESTIMONIES AND ALOT OF PEOPLE HAS MAIL AND CALLED THIS MAN ON PHONE AND AFTER 2 WEEKS THEY ALL CONFIRMED NEGATIVE..BBC NEWS TOOK IT LIVE AND EVERY.. HOPE HE HELPS YOU OUT.. EVERYBODY SAW IT AND ITS NOW OUT IN PAPERS AND MAGAZINES THAT THERE'S NATIVE CURE FOR HIV AND ALL WITH THE HELP OF THIS MAN,,HAVE TRIED MY OWN PARTS AND ALL LEFT WITH YOU,,IF YOU LIKE TAKE IT OR NOT..GOD KNOWS HAVE TRIED MY BEST.ABOUT 97 PEOPLE HAVE BEEN CONFIRMED NEGATIVE THROUGH ME..AND THEY SEND MAILS TO THANKS ME AFTER THEY HAVE BEEN CONFIRMED NEGATIVE,,THIS MAN IS REAL..DON'T MISS THIS CHANCE,,HIV IS A DEADLY VIRUS,,GET RID OF IT NOW..
case there is anyone who has similar problem and still

looking for a way out, and he those cast all kind of spell like ::
Love Spells
Luck, Money Spells
Health, Well Being
Protection, Healing
Curses, ex, Breakups
NEW! Combo Spells
High Priestess Spells
Vampire Spells
Authentic Voodoo Spells
Custom, Other Spells
Business spells
Health/Healing spells
Cancer healing
Curse removal
Job spells
Healing from all kind of diseases
Love binding
Barrenness(need a child)
Need love
Lottery Spells
Promotions
Success
Money rituals
winning court case
Divorce spells
Low sperm count
Infertility in women
Breast enlargement/reduction
Penis enlargement/reduction
YOU CAN CONTACT HIM HERE AS (dr.abalaka@outlook.com) and also his state based number text him here if you're in the US: 760-935-3804 if you need any question contact me via here as mariambaurice@gmail.com i wish you best of luck and good health.