OnliBasic

emulators, hardware and classic software for atom + system machines
Post Reply
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

OnliBasic

Post by hoglet »

Kees pointed out to me in today's ABUG call that an unusual extended version of Atom Basic called OnliBasic has been discovered on an old System 3 disk posted by Bodie: System 3 DOS

A couple more threads also touch on OnliBasic:
- Various Atom Documents
- Atom ROMs

I thought this was worthy of it's own thread.

I searched around a bit and found this:

Code: Select all

	
[CITATION] ONLIBASIC, a system for experimental control
PJ Fray - Trends in Neurosciences, 1980 - Elsevier Current Trends
And after a bit more searching the darker corners of the Web I located a copy:
Fray1980.pdf
(276.76 KiB) Downloaded 13 times
OnmiBasic is implemented as a 2K extension to what I think is the the System version of "Atom Basic".

It might be fun to do a disassembly this using SteveF's Py8Dis

to be continued....

Dave
User avatar
IanS
Posts: 1930
Joined: Mon Aug 31, 2009 7:02 pm
Contact:

Re: OnliBasic

Post by IanS »

This was the bit about the system we fiddled with at an Abug meet. viewtopic.php?p=116538#p116538

Check the pdf, page 19 - http://www.vintageacorn.com/Acorn_SystemCatalog.pdf
lbasic.PNG
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

Snap!

It also gets a mention in the 1979 Acorn Computer Catalog, on page 19:
LabInterface.png
There's a schematic of the Laboratory Interface on 4corn:
https://www.4corn.co.uk/archive/diagram ... %20PCB.jpg
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

I think that the last $800 bytes of the ONLIBAS file are the extended ONLI commands and the first $1000 is standard Basic.
That explains the 2K extension ROM.

Greetings
Kees
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

The first 4K of the 6KB OnliBasic image is a pretty close match to the version of SystemBasic here:
http://www.theoddys.com/acorn/Acorn%20S ... basic.html

There are just two differences, neither of which is specific to the OnliBasic extension

A 1-bye change at #CC13

This affects the error number returned when a GOTO/GOSUB line number is not found

The OnliBasic version returns 31, the SystemBasic version returns 127.

Atom Basic matches the SystemBasic version.

A 13 byte difference #CE57-#CE66

This is the code that makes space for a new line to be inserted into a program.

Here the OnliBasic, AtomBasic and SystemBasic versions are all slightly different:
Screenshot from 2021-09-15 16-34-55.png
CE4B is the inner loop that block moves the program up in memory to make space for the line just inserted.

Code: Select all

On entry:
    Y=0
    C=1
    #52/3 = new value of TOP
    #54/5 = old value of TOP
    #56/7 = the line input buffer at #0100 
    #58/9 = the address where the new line should be inserted
The loop works backwards, copying (#54),Y to (#52),Y until #54/5 + Y matches #58/9.

I don't see bugs in any of the versions.

The Onli and Atom versions are the most similar: only the position of an SEC moves. That seems a cosmetic change to make it clearer that C=1 before the JSR $CEA2. The System version looks slightly more efficient - it saves 4 cycles on average per program byte moved.

Based on this, I would say the Onli version is the oldest, then the Atom version, and the System version is the newest,

to be continued...
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

We actually two different versions of the 2KB OnliBasic extension ROM.
- an Atom version from the Atom ROMs ZIP
- a System version from the System 3 DOS disk

These have a few differences in the commands:
Screenshot from 2021-09-15 17-02-29.png
It looks like the PLOT/DRAW/MOVE/CLEAR commands in the System version have been replaced by a COLOUR command in the Atom version.

Here's a first cut at a disassembly of the System version:
https://github.com/hoglet67/OnliBasic/b ... iBasic.asm

I used SteveF's excellent py8dis tool

I've added meaningful names for the external BASIC routines that are called, so it's fairly straightforward to guess what each command does,

The SET, CLR and REACT commands work with the ports on the "User" 8154 on the Acorn 100,000 6502 board.

The DAC and ADC commands work with the Acorn 100,014 Analog Interface board.

The START command sets up an interrupt handler and initializes the 6522 on the Analog board:
https://github.com/hoglet67/OnliBasic/b ... c.asm#L213

It configures timer 1 as a free running counter with a period of 512 cycles (0.5ms). But it doesn't seem to actually enable timer interrupts by setting the IER (#1A3E). So I don't see how this can work.

to be continued..... (possibly)
Last edited by hoglet on Wed Sep 15, 2021 6:28 pm, edited 2 times in total.
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

Didn't know we had an Atom version .... great find.
Well it makes sense that the MOVE, PLOT, DRAW, CLEAR and COLOUR commands are different due to the different video boards in the Atom and System3.

There are CLI and SEI commands, maybe they enable/disable interrupts.

Greetings
Kees
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

oss003 wrote:
Wed Sep 15, 2021 5:27 pm
Didn't know we had an Atom version .... great find.

Well it makes sense that the MOVE, PLOT, DRAW, CLEAR and COLOUR commands are different due to the different video boards in the Atom and System3.
It definitely is an Atom version; here a mega quick disassembly:
https://github.com/hoglet67/OnliBasic/b ... iBasic.asm

It makes sense not to have the MOVE, PLOT, DRAW and CLEAR commands, as the Atom MOS has these.

The COLOUR command looks like the COLOUR command out of the FP ROM, but the screen clearing is a bit strange, as it only clear #8600-#87FF. But the exact same code is in the FP ROM, so I guess it must be correct.

But the rest looks like a horrible bodge to me...

The interript handler is not set at all in START.

It also still uses the Analog board (at #1Axx) and the 8154 (at #09xx)

Anyway, take a look and see what you think.

Dave
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

Comparing the two versions, I see the following changes in the Atom version:

1. MOVE/DRAW/PLOT/CLEAR replaced by COLOUR command (identical to version in Atom FP ROM)

2, In the START command, the STA &0204/STA &0205 instructions are replaced by NOPs

3. Polling for the ESCAPE key uses #B001 instead of #0E21

Those are really the only significant changes.

None of the other hardware addresses have changed, so the Atom version is still expecting an Analog Interface at #1Axx and an 8154 at #09xx.

Dave
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

hoglet wrote:
Wed Sep 15, 2021 6:43 pm
2, In the START command, the STA &0204/STA &0205 instructions are replaced by NOPs
I'm wondering if the Atom 2KB ONLI extension ROM was located at #A000.
The board generates 10ms IRQ pulses, if the bridge is ok on the board, which triggers and IRQ to #A000 in the Atom, like the Econet board.
This way you don't have to set the IRQ vector.

Greetings
Kees
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

oss003 wrote:
Wed Sep 15, 2021 7:28 pm
I'm wondering if the Atom 2KB ONLI extension ROM was located at #A000.
The board generates 10ms IRQ pulses which are triggerd to #A000 in the Atom, like the Econet board.
This way you don't have to set the IRQ vector.
It's clear from the addresses in the command table and the plot vector table that it was located at #D000.
Last edited by hoglet on Wed Sep 15, 2021 7:38 pm, edited 1 time in total.
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

You're right but what if there was an Atom and a System ONLI extension ROM?
Is the Atom rom 2KB or also 6KB?

Greetings
Kees
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

oss003 wrote:
Wed Sep 15, 2021 7:35 pm
Is the Atom rom 2KB or also 6KB?
It's only 2KB.
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

I've added a page of documentation describing each of the commands:
https://github.com/hoglet67/OnliBasic/b ... manual.txt

I'm still confused about who/what is responsible for the 100Hz interrupts.

Firstly, nothing on ONLI writes to the 6522 Interrupt Enable register, so it won't be generating interrupts.

Second,
The START command includes:

Code: Select all

    lda #&c0                                                ; d0c7: a9 c0
    sta analog_6522_acr                                     ; d0c9: 8d 3b 1a
    lda #&70 ; 'p'                                          ; d0cc: a9 70
    sta analog_6522_ddrb                                    ; d0ce: 8d 32 1a
    lda #&02                                                ; d0d6: a9 02
    sta analog_6522_t1cl                                    ; d0d8: 8d 34 1a
    lda #&00                                                ; d0db: a9 00
    sta analog_6522_t1ch                                    ; d0dd: 8d 35 1a
Initially I thought this this was using T1 as an interrupt source. But the value loaded into the Timer 1 latch is way too small. It's also enabling a square wave output on PB7. Looking at the Analog Interface schematic this connects to the clock input of the ADC. So it looks like the timer is being used to generate a ~250KHz clock for the ADC.

Third, in the System version, the IRQ Handler address is written to 0204/5. In the Aton version, those writes are NOPed out, and the IRQ Handler as D128 seems to be unreachable.

Code: Select all

.cmd_START
    lda #&28 ; '('                                          ; d0b4: a9 28
    nop                                                     ; d0b6: ea
    nop                                                     ; d0b7: ea
    nop                                                     ; d0b8: ea
    lda #&d1                                                ; d0b9: a9 d1
    nop                                                     ; d0bb: ea
    nop                                                     ; d0bc: ea
    nop                                                     ; d0bd: ea
    lda #&00                                                ; d0be: a9 00
    ldx #&2f ; '/'                                          ; d0c0: a2 2f
.ld0c2
    sta time,x                                              ; d0c2: 95 66
    dex                                                     ; d0c4: ca
    bpl ld0c2                                               ; d0c5: 10 fb
    lda #&c0                                                ; d0c7: a9 c0
    sta analog_6522_acr                                     ; d0c9: 8d 3b 1a
    lda #&70 ; 'p'                                          ; d0cc: a9 70
    sta analog_6522_ddrb                                    ; d0ce: 8d 32 1a
    lda #&80                                                ; d0d1: a9 80
    sta analog_8255_control                                 ; d0d3: 8d 03 1a
    lda #&02                                                ; d0d6: a9 02
    sta analog_6522_t1cl                                    ; d0d8: 8d 34 1a
    lda #&00                                                ; d0db: a9 00
    sta analog_6522_t1ch                                    ; d0dd: 8d 35 1a
.cmd_CLI
    cli                                                     ; d0e0: 58
    jmp basic_post_cmd_checks_and_next_cmd                  ; d0e1: 4c 58 c5
So the mystery remains... something external must be responsible for the 100Hz interrupts. Without these, nothing in ONLI will work properly.

Did I remember someone saying that Dave M's System at the Bolton ABUG had a weird 100Hz source of interrupts?

Dave
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

David,

If you look at the schematic of the lab board, phi2 is divided by 10000 to generate a 100hz interrupt.
With the bridges you can select IRQ or NMI.

Greetings
Kees
Attachments
100hz.png
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

oss003 wrote:
Thu Sep 16, 2021 6:34 pm
If you look at the schematic of the lab board, phi2 is divided by 10000 to generate a 100hz interrupt.
With the bridges you can select IRQ or NMI.
Well spotted - not sure how I managed to miss that :D

Mystery solved.

I guess we could try to make a "Modern" atom version that used the normal 6522 counter.
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

That's possible but if the IRQ vector is not set in the Atom version of ONLIBasic .... how are IRQ's handled?
Or the rom dump is patched ....

Greetings
Kees
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

Also noticed that the 100hz can be connected to FIRQ ..... which is pin30 of the bus ... R/W or SYNC????

Greetings
Kees
User avatar
hoglet
Posts: 10487
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: OnliBasic

Post by hoglet »

oss003 wrote:
Thu Sep 16, 2021 7:43 pm
Or the rom dump is patched ....
I think this is possible.

Why NOP out the STA instructions if you have the source?
User avatar
oss003
Posts: 3519
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: OnliBasic

Post by oss003 »

Yes, and the vector address is pointing to an IRQ routine at $d128.

Greetings
Kees
Post Reply

Return to “acorn atom and acorn system series”