Page 1 of 2

OSI BASIC Question

Posted: Sun Nov 13, 2022 9:50 pm
by nbreeden2
I plan to run OSI BASIC on my 502 CPU system build. Can BASIC works with Serial I/O or is it hardcoded for OSI video/keyboard? Based on what little docs I can find it seems hardcoded for the OSI video/keyboard.
-Neil

Re: OSI BASIC Question

Posted: Sun Nov 13, 2022 11:13 pm
by BillO
Grant Searle has a version he patched to work with the 6850 ACIA. It's from the UK-101, but that was pirated from OSI anyway. Same thing.

http://searle.x10host.com/uk101/uk101.html#ROM

Re: OSI BASIC Question

Posted: Mon Nov 14, 2022 1:59 pm
by bxdanny
The OSI BASIC-in-ROM is NOT hard coded to use OSI's keyboard and screen. Instead, it makes calls to the monitor/support ROM on page $FF for all I/O. There are five jump locations on $FF page that can be configured for whatever hardware you have:

$FFEB - should jump to the character input routine (character should be returned in .A)
$FFEE - should jump to the character output routine (character to output is in .A)
$FFF1 - should jump to the Control-C check routine
-----(RTS to continue the program, or load .A with 3 and JMP $A636 to cause a BREAK message. Just setting the carry and doing a JMP $A63D also works.)
$FFF4 - should jump to whatever you want the LOAD command to do.
$FFF7 - should jump to whatever you want the SAVE command to do.

All routines should end with an RTS, except when Control-C is detected, as described above.

Notice that these JMP instructions immediately precede the CPU interrupt and reset vectors in the ROM. On the 4P and 8P machines with the standard ROM, these were direct jumps ($4C opcode), so the user really couldn't change what they did. On the C1P/SB II, they were replaced by indirect jumps ($6C opcode), using the contents of the words at $0218 through $0220, respectively, to set the addresses of the actual routines used, also on the UK101. This added a lot of flexibility, and CEGMON copied that scheme even on the 4P and 8P systems.

Re: OSI BASIC Question

Posted: Mon Nov 14, 2022 5:03 pm
by nbreeden2
Thanks - the Searle site has a lot of info and interesting content. From the ROM image on it and the schematics I finally understand:
BASIC ROMS live between $A000 and $BFFF
$BFFF
$B800 BASIC ROM D/4
$B7FF
$B000 BASIC ROM C/3
$AFFF
$A800 BASIC ROM B/2
$A7FF
$A000 BASIC ROM A/1
and how this is implemented in the schematic.
-Neil

Re: OSI BASIC Question

Posted: Tue Nov 15, 2022 9:00 pm
by Mark
I found the OSI serial system ROM which is used with OSI BASIC-In-ROM machines now located here on my ROMS page.
It also includes an assembler file which builds the original ROM. Pair this with the OSI 65A monitor ROM & BASIC to have a full serial system with BASIC-In-ROM. If nothing else, the source should give you a working example of the steps outlined by bxdanny previously.

This ROM utilizes the OSI 430 board UART and cassette interface @ FB03+ to do loads & saves, however if there is no 430 board installed, the SAVE routine really does nothing and LOAD just inputs '{' characters until stopped. (You don't really need load and save with a smart terminal .) All the I/O support is already built in to the OSI BASIC ROMS for the most part. There is code in there to support the 6850 ACIA as well as the S1883/AY-5-1013 UART.

It's interesting to see how OSI suppressed console output during SAVE, watching for the 'OK' message in the output stream from BASIC to re-enable output. You can also toggle output with a ^E character.

This ROM was found in a 1702 on an OSI500 CPU board. I later realized the same ROM code was on an unused page of a ROM "C3ROM68" used to support the 6800 on an OSI510 board.

Anyway it looks like you're already on your way to a serial OSI BASIC system!

Cheers!

Re: OSI BASIC Question

Posted: Wed Nov 16, 2022 6:15 am
by bxdanny
Hi Mark,

That 65AB ROM is a nice find, I hadn't seen it before. But I am wondering about that JMP $A319 at the end of the LOAD and SAVE routines. It appears to go to code involved in inserting or deleting lines of the BASIC program, which makes no sense at all. Did they just want to avoid sending (and detecting) the OK message at that point? They could have just gone to $A27D if that was it, so it is quite puzzling.

By coincidence, I had also used $0204 for storing the value of the X register during character output, in my Enhanced Pico-DOS (through version 1.34, changed to $020F in 1.35 to avoid a conflicting use by CEGMON). BTW, I will soon be posting an updated version 1.36 of that (which I certainly expect will be the last one).

Re: OSI BASIC Question

Posted: Wed Nov 16, 2022 12:49 pm
by bxdanny
$A319 is in fact the code to relink the lines of a program. So I guess calling it does no harm, other than clearing all variables (and resetting the DATA pointer). It still seems very strange that that would be called. Maybe Microsoft said in some early documentation that that should be called after doing a LOAD. That's something OSI failed to do in OS-65D.

Re: OSI BASIC Question

Posted: Wed Nov 16, 2022 6:50 pm
by Mark
$A319 is in fact the code to relink the lines of a program. So I guess calling it does no harm, other than clearing all variables (and resetting the DATA pointer).
Ah, that makes sense.

It's amazing that the exact same BASIC ROM set was usable with so many different configurations with just a small external support ROM. "Richard W. Weiland" knew his stuff.

So I know the OSI 440 board had support for a 7-bit ASCII keyboard, but some of the system ROM images I've found such as SYNMON1 page1 use an ASCII interface but with OSI540 based screen coordinates. So it appears an OSI540 could be used with an ASCII keyboard too. The 540 keyboard connector looks like it would work with a straight connection to an ASCII interface chip like AY-5-2376. I don't recall ever seeing anything about what OSI had as a recommended ASCII input.

I'm not sure what the official OSI part numbers/product numbers were for all these ROMS. BillDrom sent this a while ago:
OSI ROM Products
OSI ROM Products
osi-rom-products.png (445.41 KiB) Viewed 2922 times
It seems the 65V and 65V2P could have been almost or exactly identical, unless the 'P' stands for polled, and the original one was for ASCII. The 65-500F2 could be the "H/D/M" version of the system ROM or something we haven't seen yet for the 500CPU. All the $99 packages would seem to include OSI BASIC, and all the $29 packages seem to be a single ROM... There is probably a price list out there somewhere that enumerates all these configurations. Anyway, thanks for the insight!
-Mark

Re: OSI BASIC Question

Posted: Wed Nov 16, 2022 10:34 pm
by bxdanny
I think there was an early version of the C2-4P that used an encoded ASCII keyboard with the 540. I never saw one in person, but I've seen a photo of one. IIRC, a few important keys (maybe the shift keys, spacebar, <return>, and Rubout ?) were white, and the others grey.

The 65-500F2 was probably the D/M? PROM that I posted a partial disassembly of a while ago. Does that mean that there was a slightly different 65F PROM used on the 400 board?

Re: OSI BASIC Question

Posted: Fri Feb 10, 2023 10:27 am
by musovern
Hi to all,

I thought I would just like say I tried out Marks ROM images on my Replica 502 board using he 65AB and the 65A monitor ROM and they work great running BASIC over serial, thank you very much.

This has helped me get a bit further on in my quest to build up a system. Now I have the 65A monitor running I can hopefully test out my 540b video board that seems to have problems. The characters seem like they are spit on the screen and doesn't clear when reset. Would anyone no if there is a small monitor program to test the 540b screen memory.?