• Please review our updated Terms and Rules here

Altair 680b BASIC merged with 6502 source

Bruce Tomlin

Experienced Member
Joined
Jan 5, 2010
Messages
490
Location
San Antonio, TX
Having recently started working with an old 6802 computer ( https://forum.vcfed.org/index.php?threads/early-1990s-telemarketing-dialer.1247949/#post-1383782 ), I decided that I wanted to get the 680b BASIC running on it. But I needed to be able to change the I/O, and I just wouldn't be satisfied with mere overlay patches, especially since the way it dealt with memory really didn't leave good patch space.

So I disassembled it, and found that it has significant similarity to the 6502 version that surfaced a few years ago. ( https://www.pagetable.com/?p=774 ) I was able to replace most of the disassembler labels with real labels from that source code. After a little speed bump of one missed reference in my disassembly, I now have it running.

It looks like it will be too much trouble to add features while still allowing it to generate the original binary and to keep the original comments. (most of the comments were not very good anyhow) So I'm going to abandon this version of the source and make a cleaner version without that all excess baggage, and I'm going to upload this version first.

And I think I found one bug. At 03BD (just before FINI) there is a TPA instruction that should probably have been TAP. This would cause interrupts to become permanently disabled from that point onward. It was probably never noticed because nobody ever needed to use interrupts with it.

Note: I used my asmx assembler (see sig) to build it. "asmx -C 6800 -l -o -e -s9 basic.asm"
 

Attachments

This may prove very useful for me!
I am trying to port 680b BASIC to a computer I built that utilizes an MC6801. I began with the work from: //gitlab.com/retroabandon/altair-680-basic
In fact, your document has already been very helpful. While cleaning up labels in the file I got from retroabandon, I found a branch to an operand that is an illegal opcode for the 6800 but not the 6801. This was at $08B7. This was going to be a real head-scratcher for me to address but your document shows my errantly disassembled code has the text string: "TRYAGN: FCC /?REDO FROM STAR/,'T'+$80" at the offending location.
Now I just need to decide if I want to modify your .asm file to compile with crasm or learn how to use yours.
Thanks again!
 
Here's just the labels file from my disassembly that I correlated with the 6502 version, maybe you can incorporate it into your own source. (I knew there was a good reason to keep that as a plain text file.)

Also be aware there's a bug where 03BD should be TAP (06) instead of TPA. (pretty sure I confirmed that with the MC-10 version)
 

Attachments

I wish that I'd found your files weeks ago.
I got asmx compiled. The make utility did not work because I did not have cc installed. I did have gcc, but Windows passed the *.c wildcard to gcc and of course it failed. There are more elegant ways to solve the problem than this, but just creating a command line with every .c file explicitly stated only took a moment and worked just fine.
Going through your source file, I found that issues I was having with my original source file were usually instances of data fields being treated as code and decompiled as such. Once all of those were accounted for, everything else that looked suspicious was just a skip trick. Like I said: I wish I'd found your source code first. Thank you for your hard work.
Since the MC6801 runs MC6800 code, I don't really need to port anything. I just need to clear out the first 32 bytes, as those are my control registers.
I think that at first, I am going to move the start code to just before the math functions, and shrink the size of the buffer. If that functions properly, I'll see what I can do to get the buffer space back. Maybe I could do something creative with the internal RAM.
 
Back
Top