Difference between revisions of "OSGBPB"
(→Specification) |
m (→Specification) |
||
Line 9: | Line 9: | ||
|- align="center" valign="top" | |- align="center" valign="top" | ||
| YX || HL || X || R1 || BX || || || align="left" | =>control block || align="left" valign="top" | undefined, control block updated | | YX || HL || X || R1 || BX || || || align="left" | =>control block || align="left" valign="top" | undefined, control block updated | ||
+ | |- align="center" valign="top" | ||
+ | | || || || || || || || align="left" | || align="left" valign="top" | Cy=EOF, but see notes | ||
|- | |- | ||
| colspan="5" align="center" valign="top" | '''Control block''' || colspan="2" | || || | | colspan="5" align="center" valign="top" | '''Control block''' || colspan="2" | || || | ||
|- align="center" valign="top" | |- align="center" valign="top" | ||
− | | colspan="5" | &00 || R2 || R1 || align="left" valign="top" | Handle || align="left" valign="top" | Cycle Number | + | | colspan="5" | &00 || R2 || R1 || align="left" valign="top" | Handle || align="left" valign="top" | Handle or Cycle Number |
|- align="center" valign="top" | |- align="center" valign="top" | ||
| colspan="5" | &01 || R3 || R2 || align="left" | Data Address || align="left" | Updated Data Address | | colspan="5" | &01 || R3 || R2 || align="left" | Data Address || align="left" | Updated Data Address | ||
Line 20: | Line 22: | ||
| colspan="5" | &09 || R5 || R4 || align="left" | Offset || align="left" | Updated Offset | | colspan="5" | &09 || R5 || R4 || align="left" | Offset || align="left" | Updated Offset | ||
|- align="center" valign="top" | |- align="center" valign="top" | ||
− | | colspan="5" | &0D || || || align="left" | || align="left" | | + | | colspan="5" | &0D || || || align="left" | || align="left" | |
|} | |} | ||
<p> | <p> |
Revision as of 10:29, 19 September 2022
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 |
YX | HL | X | R1 | BX | =>control block | undefined, control block updated | ||
Cy=EOF, but see notes | ||||||||
Control block | ||||||||
&00 | R2 | R1 | Handle | Handle or Cycle Number | ||||
&01 | R3 | R2 | Data Address | Updated Data Address | ||||
&05 | R4 | R3 | Count | Updated Count | ||||
&09 | R5 | R4 | Offset | Updated Offset | ||||
&0D |
Function summary | |||
Core functions | Extensions | ||
&01 | Write bytes using pointer | &09 | Read names from specified directory |
&02 | Write bytes to current pointer | &0A | Read names and information |
&03 | Read bytes using pointer | &0B | Read names and extended information |
&04 | Read bytes from current pointer | &0C | Read names and filetype information |
&05 | Read title and boot option | ||
&06 | Read directory name | ||
&07 | Read library name | ||
&08 | Read objects names from current dir. |
Functions
&01 | Write bytes to open file using new pointer. |
&02 | Write bytes to open file ignoring new pointer. |
&03 | Read bytes from open file using new pointer. |
&04 | Read bytes from open file ignoring new pointer. |
| |
&05 | Read title and boot option of CSD disk into data block:
|
&06 | Read currently selected directory name into data block:
|
&07 | Read current library name into data block:
|
&08 | Read object names from current directory into data block:
|
&09 | Reads object names from directory, work/login filename, command line tail:
Reading object names:
Reading work/login filename or command line tail:
|
&0A | Read object names and information from the opened directory whose channel number is passed in the handle. If the channel is zero the current directory is scanned. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long:
|
&0B | Read object names and extended information from the opened directory whose channel number is passed in the handle. If the channel is zero the current directory is scanned. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long:
|
&0C | Read object names and filetype information from the opened directory whose channel number is passed in the handle. If the channel is zero the current directory is scanned. 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.
In Opus EDOS and Slogger Challenger, OSGBPB 5 does not return the CSD drive number. In Opus DDOS the drive number byte includes a representation of the volume letter in bits 6..4.
In Opus/Slogger filing systems the drive identity returned by OSGBPB 6 and 7 consists of one or two characters, the first being the ASCII drive digit 0..3 and the second being the optional volume letter A..H.
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.
65Tube
The emulator traps implemented in 65Tube allows calls to OSGBPB with A>9 to pass additional parameters:
On entry: | On exit: | ||
XY?0 | = ignored | XY?0 | = directory cycle |
XY!1 | = address | XY!1 | = updated address |
XY!5 | = count | XY!5 | = returned count |
XY!9 | = offset | XY!9 | = updated offset |
XY!13 | =>directory name | XY!13 | = preserved |
XY!17 | =>wildcard to match | XY!17 | = preserved |
6502Em
The emulator traps implemented in Warm Silence's 6502Em implement OSGBPB 9 to read object names from the current directory, but use the control block contents differently from the standard:
On entry: | On exit: | ||
XY?0 | = count | XY?0 | = returned count |
XY!1 | = address | XY!1 | = preserved |
XY!5 | = buffer length | XY!5 | = preserved |
XY!9 | = offset | XY!9 | = updated offset |
Filing System Calls | |
---|---|
Jgharston 17:01, 6 November 2009 (UTC) Jgharston (talk) 15:56, 30 September 2016 (UTC)
Jgharston (talk) 00:03, 3 October 2016 (UTC)