[BBC-Micro] 6502 second processor ROM disassembly

John Kortink kortink at inter.nl.net
Tue May 6 20:11:47 BST 2014

On Tue, 06 May 2014 18:28:51 +0100, Steven Flintham <mlist at lemma.co.uk> wrote:

>Thank you both, this is fascinating. I didn't realise the ROM was 
>actually 4K either. (I know very little about the second processor, 
>hence looking at this.)

Hardware precedes software. Sometimes by quite some time.

It is quite likely that a (close to) 4 KB OS was expected, at
first. But they managed to squeeze it into 2 KB (BASICally
freeing another 2 KB of RAM, pun intended).

Maybe the OS was somewhat of a rush job. Not especially because
of the few small bugs (although there is also very little code,
really), but more so because no 65C02 specific instructions were
used anywhere. Or perhaps Acorn expected to be using an actual
6502 (as opposed to a 65C02).

>What has been puzzling me is how OSWORD 14 (read CMOS time) with 
>function 0 (read clock value as string) works across the tube. The 
>returned data is 24 bytes. Looking at the OSWORD control block length in 
>JGH's disassembly of 1.10 and a random copy of 1.10 I managed to find on 
>the web, the tube OS expects 24 bytes to be returned. Which is great and 
>makes sense and doesn't confuse me at all.

The Master Reference Manual says 'OSWORD 14 with XY=2 will not work
with certain early external 6502 second processors'. It would seem
that this refers to an OS earlier than 1.10. I bought a 6502 second
processor back in the day, 1983/84-ish, and mine already had 1.10.
I don't think I ever saw an earlier version, but it must have been
there (perhaps in the form of an EPROM, 1.10 is also around in mask
ROM, I have several).

>Except... looking at app note 4, I found two copies. The earliest, at 
>http://www.sprow.co.uk/bbc/hardware/armcopro/004.pdf, is dated 16 June 
>1992 and says OSWORD 14 receives 16 bytes. A slightly more recent one 
>dated 12 October 1992 at http://mdfs.net/Info/Comp/Acorn/AppNotes/004 
>says it receives 25 bytes.
>Is this just a case of app note 4 always having been wrong? That would 
>make sense and would explain everything.

I think so.

>What originally provoked my curiosity was the idea of attaching an 
>original "BBC B"-era 6502 second processor to a Master 128. BASIC 4 
>would AIUI be copied across into the second processor and execute 
>happily there, including using OSWORD 14 to handle TIME$. But the OS ROM 
>in the second processor would predate the definition of OSWORD 14 and at 
>least according to the documentation it appeared that it would only 
>transfer 16 bytes.
>I've never laid hands on a physical second processor, but I just tried 
>this in BeebEm and TIME$ does work as expected in a Master 128 with OS 
>1.10 second processor attached.
>Was there an upgrade to the tube OS needed to make it work with the 
>additional OSWORDs in OS 3.20? Does the host patch the tube ROM in any 
>way? Or was it all thought out in advance and worked perfectly, except 
>for some errors in app note 4? Or have I got completely confused? :-)

The new call was probably anticipated (for the B+ perhaps). Early
enough for 1.10 to contain the right count.

John Kortink


Email    : kortink at inter.nl.net
Homepage : http://www.inter.nl.net/users/J.Kortink

GoSDC, the ultimate BBC B/Master/Electron storage system :

More information about the bbc-micro mailing list