Difference between revisions of "OSBYTE &07"

From BeebWiki
Jump to: navigation, search
m (Altered code to recognise that rates skip 600.)
 
m (1 revision)
(No difference)

Revision as of 23:58, 28 August 2013


OSBYTE &07 (7) - Select the receive rate to be used on the RS423 interface.

On entry, A=&07, X=receive rate

On exit, A=&07, X=Y=previous contents of Serial ULA control register (B+ User Guide)

The value of X is made up as follows:

Value Meaning if set
1 75 baud receive
2 150 baud receive
3 300 baud receive
4 1200 baud receive
5 2400 baud receive
6 4800 baud receive
7 9600 baud receive
8 19200 baud receive. This rate is not guaranteed.

A baud rate can be converted to a *FX7/*FX8 parameter with the following code:

   A%=baud%:IFA%>63:A%=LN(A%DIV75)/LN2:IFA%<4:A%=A%+1

A *FX7/8 parameter can be converted into a baud rate with the following code:

   A%=rate%:IFA%<64:A%=A%+(A%<4):A%=75*2^A%

See also