Difference between revisions of "OSGBPB"
m (1 revision) |
m (1 revision) |
(No difference)
|
Revision as of 19:13, 8 March 2015
Read or write multiple bytes of data
Contents
Specification
6502 | Z80 | 6809 | PDP11 | 80x86 | 32016 | ARM | On entry: | On exit: |
A | A | A | R0 | AL | R1 | R0 | = function code | = &00 if supported, preserved if not supported, but see notes. |
XY | HL | X | R1 | BX | =>control block | undefined | ||
Control block | ||||||||
&00 | R2 | R1 | Handle | Cycle number | ||||
&01 | R3 | R2 | Data address | Updated Data address | ||||
&05 | R4 | R3 | Number of bytes or objects to transfer | Updated Number of bytes or objects | ||||
&09 | R5 | R4 | Pointer to use for transfer | Updated Pointer | ||||
&0D | ||||||||
Cy=EOF status (but see notes) |
Functions | |
&01 | Write bytes to media using new pointer. |
&02 | Write bytes to media ignoring new pointer. |
&03 | Read bytes from media using new pointer. |
&04 | Read bytes from media ignoring new pointer. |
| |
&05 | Get media title of CSD disk and boot option into data block:
|
&06 | Get currently selected directory name into data block:
|
&07 | Get current library name into data block:
|
&08 | Read filenames from current directory into data block:
|
&09 | Reads work/login filename, command line tail or entries from specified directory. If the handle is zero, reads work/login filename or command tail:
|
&0A | Read entries and information from the opened directory whose channel number is passed in the handle. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long:
|
&0B | Read entries and information from the opened directory whose channel number is passed in the handle. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long:
|
&0C | Read entries and information from the opened directory whose channel number is passed in the handle. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long:
|
Notes
Some filing systems preserve A even if they support the function.
Many filing systems do not return Carry consistently. The only consistent way of telling if the end of file has been reached is to test whether the updated number of bytes/objects is unequal to zero.
Calling from BBC BASIC
BBC BASIC makes no calls to OSGBPB.
Entry points
- BBC BASIC Entry Address: &FFD1
- 6502 Entry Address: &FFD1, vectors via &021A
- Z80 Entry Address: &FFD1, vectors via &FFD2
- 6809 Entry Address: &FFD1, vectors via &FFD2
- 80x86 Entry Address: INT &41, vectors via 0000:0104
- 32000 Entry Address: SVC &0F
- PDP-11 Entry Address: EMT 11, vector &0B
- ARM Entry Address: SWI &0C "OS_GBPB", vector &0C
Implementations
CFS
Not implemented, simply returns with an RTS instruction.
The Master 128 implements &02 and &04.
ROMFS
Not implemented, simply returns with an RTS instruction.
The Master 128 implements &04.
DFS
Acorn DFS and contemporary filing systems implement functions &01 to &08 inclusive. Watford DFS implements &09 to read the work name.
ADFS
ADFS implements &01 to &08
HADFS
HADFS implements &01 to &0B.
Z80Tube
The Z80Tube Z80 emulator implements OSGBPB 9,0 to read the command line tail.
Jgharston 17:01, 6 November 2009 (UTC)