OSWRCR

From BeebWiki
Jump to: navigation, search

An unofficial entry point to the MOS that sends a carriage return to the current output stream(s).

Specification

6502 Z80 6809 PDP11 80x86 32016 ARM 68000 RISC-V On entry: On exit:
A A A R0 AL R1 R0 D0 A0   = &0D

Prints an ASCII carriage return (CR) via OSWRCH to the currently selected output stream(s). This is an undocumented system call and is platform dependent.

Compare with OSNEWL, an official call to print a newline sequence.

Calling from BBC BASIC

  • BASIC does not call OSWRCR

Entry points

  • BBC BASIC Entry Address: none
  • 6502 Entry Address: &FFEC
  • Z80 Entry Address: &FFEC
  • 6809 Entry Address: &FFEC
  • 80x86 Entry Address: &FFEC from BBC BASIC
  • 32000 Entry Address: none
  • PDP11 Entry Address: MOV #&0D,R0:EMT &04
  • ARM Entry Address: SWI &10D "OS_WriteI"+13
  • 68000 Entry Address: MOV #&10D,A0:TRAP 12
  • RISC-V Entry Address: MOV #&0D,A0:ECALL &AC0004

Implementations

Although undocumented, the code at the entry point exists in the 6502 and Z80 MOS and the 80x86 BASIC runtime due to the way the entry code is written. BBC BASIC on other platforms does not emulate this entry point.

-- beardo 00:53, 14 June 2007 (BST)