Difference between revisions of "6809 Second Processor"

From BeebWiki
Jump to: navigation, search
m (See also)
(Notes on little-endianness, added extra Tube routines.)
Line 1: Line 1:
[[Category:Second_Processors]]
+
[[Category:Second_Processors]]__NOTOC__
__NOTOC__
+
A [[Second Processor|second processor]] for the BBC/Master containing a
An [[Second Processor]] for the BBC/Master containing a Motorola 6809.
+
Motorola 6809.
  
 
The 6809 client MOS provides the basic system required to communicate with
 
The 6809 client MOS provides the basic system required to communicate with
 
the host computer. The BBC MOS entry block is implemented by using the BA/BS
 
the host computer. The BBC MOS entry block is implemented by using the BA/BS
signals to remap the hardware vectors to from &FFF0 to &FEF0.
+
signals to remap the hardware vectors to from &FFF0 to &FEF0.
  
 
== MOS API Calls ==
 
== MOS API Calls ==
 
Programs communicate with the kernal and MOS via an entry block at
 
Programs communicate with the kernal and MOS via an entry block at
&FFC0-&FFFF. Parameters are passed in the A, X and Y registers.
+
&FF80-&FFFF. Parameters are passed in the A, X and Y registers.
  
 
<pre>On entry, A, X, Y contain values to pass to system call
 
<pre>On entry, A, X, Y contain values to pass to system call
 
On exit,  A, X, Y contain returned data
 
On exit,  A, X, Y contain returned data
           If an error occurs, then...
+
           All addresses are little-endian, except where noted
 
</pre>
 
</pre>
 
=== &FFF7 - OS_CLI ===
 
=== &FFF7 - OS_CLI ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
X=>command string       A=Return value
+
X=>command string       A=Return value
 
</pre>
 
</pre>
 
=== &FFF4 - OS_BYTE ===
 
=== &FFF4 - OS_BYTE ===
<pre>On entry:           On exit
+
<pre>On entry:               On exit
A=function         A=preserved
+
A=function             A=preserved
X=first parameter   X=returned word
+
X=first parameter       X=returned word
Y=second parameter Y=returned word DIV 256
+
Y=second parameter     Y=returned word DIV 256
                    Cy=returned carry flag
+
                        Cy=returned carry flag
 
</pre>
 
</pre>
 
=== &FFF1 - OS_WORD ===
 
=== &FFF1 - OS_WORD ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=function         Control block updated
+
A=function             Control block updated
X=>control block   X=returned line length for OSWORD 0
+
X=>control block       X=returned line length for OSWORD 0
 +
Text buffer address at X+0/1 with OSWORD 0 is big-endian
 
</pre>
 
</pre>
 
=== &FFEE - OS_WRCH ===
 
=== &FFEE - OS_WRCH ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=character         A=preserved
+
A=character             A=preserved
 
</pre>
 
</pre>
 
=== &FFEC - OS_WRCR ===
 
=== &FFEC - OS_WRCR ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
                    A=13
+
                        A=13
 
</pre>
 
</pre>
 
=== &FFE7 - OS_NEWL ===
 
=== &FFE7 - OS_NEWL ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
                    R1=13
+
                        A=13
 
</pre>
 
</pre>
 
=== &FFE3 - OS_ASCI ===
 
=== &FFE3 - OS_ASCI ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=character         A=preserved
+
A=character             A=preserved
 
</pre>
 
</pre>
 
=== &FFE0 - OS_RDCH ===
 
=== &FFE0 - OS_RDCH ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
                    A=character
+
                        A=character
                    Cy=carry flag
+
                        Cy=carry flag
 
</pre>
 
</pre>
 
=== &FFDD - OS_FILE ===
 
=== &FFDD - OS_FILE ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=function         A=result
+
A=function             A=result
X=>control block   X=preserved
+
X=>control block       X=preserved
 +
Filename address at X+0/1 is big-endian
 
</pre>
 
</pre>
 
=== &FFDA - OS_ARGS ===
 
=== &FFDA - OS_ARGS ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=function         A=result
+
A=function             A=result
Y=handle           Y=preserved
+
Y=handle               Y=preserved
X=>data             X=preserved
+
X=>data                 X=preserved
                    data updated
+
                        data updated
 
</pre>
 
</pre>
 
=== &FFD7 - OS_BPUT ===
 
=== &FFD7 - OS_BPUT ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=byte             A=preserved
+
A=byte                 A=preserved
Y=handle           Y=preserved
+
Y=handle               Y=preserved
 
</pre>
 
</pre>
 
=== &FFD4 - OS_BGET ===
 
=== &FFD4 - OS_BGET ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
                    A=byte
+
                        A=byte
Y=handle           Y=preserved
+
Y=handle               Y=preserved
                    Cy=carry flag
+
                        Cy=carry flag
 
</pre>
 
</pre>
 
=== &FFD1 - OS_GBPB ===
 
=== &FFD1 - OS_GBPB ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=function
+
A=function             A=preserved
X=>control block   A=preserved
+
X=>control block       Cy=carry flag
                    Cy=carry flag
 
 
</pre>
 
</pre>
 
=== &FFCE - OS_FIND ===
 
=== &FFCE - OS_FIND ===
<pre>On entry:           On exit:
+
<pre>On entry:               On exit:
A=function         A=handle
+
A=function             A=handle
 
X=>string or
 
X=>string or
 
Y=>handle
 
Y=>handle
 
</pre>
 
</pre>
 +
 +
=== &FFA1 - SCANHEX  ===
 +
=== &FFA7 - OSQUIT  ===
 +
=== &FFAA - PRHEX    ===
 +
=== &FFAD - PR2HEX  ===
 +
=== &FFB0 - USERINT  ===
 +
=== &FFB3 - PRTEXT  ===
 +
=== &FFB9 - CLICOM  ===
 +
=== &FFBC - ERRJMP  ===
 +
=== &FFBF - INITERR  ===
 +
=== &FFC5 - PRSTRING ===
 +
 +
 +
== See also ==
 +
* [[6809 BBC BASIC]]
  
 
==External links==
 
==External links==
 
* [http://mdfs.net/tube/6809 6809 CoPro information at mdfs.net]
 
* [http://mdfs.net/tube/6809 6809 CoPro information at mdfs.net]
 
* [http://mdfs.net/Archive/BBCMicro/2009/07/16/220501.htm Johan Heusevelt's 6809 CoPro]
 
* [http://mdfs.net/Archive/BBCMicro/2009/07/16/220501.htm Johan Heusevelt's 6809 CoPro]
* Matchbox coprocessor
 
  
 
[[User:Jgharston|Jgharston]] 16:53, 6 November 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 16:53, 6 November 2009 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 23:41, 30 January 2016 (UTC)

Revision as of 01:41, 31 January 2016

A second processor for the BBC/Master containing a Motorola 6809.

The 6809 client MOS provides the basic system required to communicate with the host computer. The BBC MOS entry block is implemented by using the BA/BS signals to remap the hardware vectors to from &FFF0 to &FEF0.

MOS API Calls

Programs communicate with the kernal and MOS via an entry block at &FF80-&FFFF. Parameters are passed in the A, X and Y registers.

On entry, A, X, Y contain values to pass to system call
On exit,  A, X, Y contain returned data
          All addresses are little-endian, except where noted

&FFF7 - OS_CLI

On entry:               On exit:
X=>command string       A=Return value

&FFF4 - OS_BYTE

On entry:               On exit
A=function              A=preserved
X=first parameter       X=returned word
Y=second parameter      Y=returned word DIV 256
                        Cy=returned carry flag

&FFF1 - OS_WORD

On entry:               On exit:
A=function              Control block updated
X=>control block        X=returned line length for OSWORD 0
Text buffer address at X+0/1 with OSWORD 0 is big-endian

&FFEE - OS_WRCH

On entry:               On exit:
A=character             A=preserved

&FFEC - OS_WRCR

On entry:               On exit:
                        A=13

&FFE7 - OS_NEWL

On entry:               On exit:
                        A=13

&FFE3 - OS_ASCI

On entry:               On exit:
A=character             A=preserved

&FFE0 - OS_RDCH

On entry:               On exit:
                        A=character
                        Cy=carry flag

&FFDD - OS_FILE

On entry:               On exit:
A=function              A=result
X=>control block        X=preserved
Filename address at X+0/1 is big-endian

&FFDA - OS_ARGS

On entry:               On exit:
A=function              A=result
Y=handle                Y=preserved
X=>data                 X=preserved
                        data updated

&FFD7 - OS_BPUT

On entry:               On exit:
A=byte                  A=preserved
Y=handle                Y=preserved

&FFD4 - OS_BGET

On entry:               On exit:
                        A=byte
Y=handle                Y=preserved
                        Cy=carry flag

&FFD1 - OS_GBPB

On entry:               On exit:
A=function              A=preserved
X=>control block        Cy=carry flag

&FFCE - OS_FIND

On entry:               On exit:
A=function              A=handle
X=>string or
Y=>handle

&FFA1 - SCANHEX

&FFA7 - OSQUIT

&FFAA - PRHEX

&FFAD - PR2HEX

&FFB0 - USERINT

&FFB3 - PRTEXT

&FFB9 - CLICOM

&FFBC - ERRJMP

&FFBF - INITERR

&FFC5 - PRSTRING

See also

External links

Jgharston 16:53, 6 November 2009 (UTC) Jgharston (talk) 23:41, 30 January 2016 (UTC)