Difference between revisions of "OSBPUT"

From BeebWiki
Jump to: navigation, search
(Added RISC-V.)
m (Calling from BBC BASIC)
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
==Specification==
 
==Specification==
 
{| cellpadding="0" cellspacing="0" border="1"
 
{| cellpadding="0" cellspacing="0" border="1"
| 6502 || Z80 || 6809 || PDP11 || 80x86 || 32016 || ARM || RISC-V || align="left" | '''On entry:''' || align="left" | '''On exit:'''
+
| 6502 || Z80 || 6809 || PDP11 || 80x86 || 32016 || ARM || 68000 || RISC-V || align="left" | '''On entry:''' || align="left" | '''On exit:'''
 
|- align="center" valign="top"
 
|- align="center" valign="top"
| A || A || A || R0 || AL || R1 || R0 || A0 || align="left" | = byte to write  || align="left" | preserved
+
| A || A || A || R0 || AL || R1 || R0 || D0 || A0 || align="left" | = byte to write  || align="left" | preserved
 
|- align="center" valign="top"
 
|- align="center" valign="top"
| Y || H || Y || R1 || BX || R2 || R1 || A1 || align="left" | = handle        || align="left" | preserved
+
| Y || H || Y || R1 || BX || R2 || R1 || D1 || A1 || align="left" | = handle        || align="left" | preserved
 
|}
 
|}
  
Line 14: Line 14:
  
 
==Calling from BBC BASIC==
 
==Calling from BBC BASIC==
* '''<code>BPUT#ch%,b%</code'''> calls OSBPUT.
+
* '''<code>BPUT#ch%,b%</code>''' calls OSBPUT.
  
 
==Special handles==
 
==Special handles==
Line 28: Line 28:
 
* PDP-11 Entry Address: EMT 10, vector &0A
 
* PDP-11 Entry Address: EMT 10, vector &0A
 
* ARM Entry Address: SWI &0B "OS_BPut", vector &0B
 
* ARM Entry Address: SWI &0B "OS_BPut", vector &0B
 +
* 68000 Entry Address: MOV #&0B,A0:TRAP 12
 
* RISC-V Entry Address: ECALL &AC000A
 
* RISC-V Entry Address: ECALL &AC000A
  

Latest revision as of 20:10, 17 September 2023

OSBPUT: Write (put) a byte

Specification

6502 Z80 6809 PDP11 80x86 32016 ARM 68000 RISC-V On entry: On exit:
A A A R0 AL R1 R0 D0 A0 = byte to write   preserved
Y H Y R1 BX R2 R1 D1 A1 = handle preserved

An error is generated if the object is a directory or doesn't have write access. The EOF-error-flag is cleared.

Calling from BBC BASIC

  • BPUT#ch%,b% calls OSBPUT.

Special handles

Some systems allow BPUT#0 to write to the character output stream via OSWRCH.

Entry points

  • BBC BASIC Entry Address: &FFD4
  • 6502 Entry Address: &FFD4, vectors via &0218
  • Z80 Entry Address: &FFD4, vectors via &FFD5
  • 6809 Entry Address: &FFD4, vectors via &FFD5
  • 80x86 Entry Address: INT &42, vectors via 0000:0108
  • 32000 Entry Address: SVC &0E
  • PDP-11 Entry Address: EMT 10, vector &0A
  • ARM Entry Address: SWI &0B "OS_BPut", vector &0B
  • 68000 Entry Address: MOV #&0B,A0:TRAP 12
  • RISC-V Entry Address: ECALL &AC000A

Implementations

OSBPUT is implemented by all filing systems that allow writing.

See also

Filing System Calls
  • OSFILE : File and directory operations
  • OSARGS : Information on open objects
  • OSBGET : Read (get) a byte
  • OSBPUT : Write (put) a byte
  • OSGBPB : Read or write multiple bytes of data
  • OSFIND : Open or close an object
  • FSCV : Filing system control

Jgharston 16:57, 6 November 2009 (UTC)