OSRDCH

From BeebWiki
Jump to: navigation, search

Waits for a character from the current input stream.

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 read
Cy=Error status

If an error occured (usually, Escape being pressed), then the carry flag is set on exit. If the error was Escape, then A will be &1B regardless of the defined Escape character.

Calling from BBC BASIC

  • b%=GET calls OSRDCH.
  • b$=GET$ calls OSRDCH.

Entry points

  • BBC BASIC Entry Address: &FFE0
  • 6502 Entry Address: &FFE0, vectors via &0210
  • Z80 Entry Address: &FFE0, vectors via &FFE1
  • 6809 Entry Address: &FFE0, vectors via &FFE1
  • 80x86 Entry Address: INT &46, vectors via 0000:0118
  • 32000 Entry Address: SVC &05
  • PDP11 Entry Address: EMT 5, vector &05
  • ARM Entry Address: SWI &04 "OS_ReadC", vector &04
  • 68000 Entry Address: MOV #&04,A0:TRAP 12
  • RISC-V Entry Address: ECALL &AC0005

Implementations

All MOSs implement OSRDCH. Some systems allow BGET#0 to read from the character input stream via OSRDCH.

Jgharston 17:02, 6 November 2009 (UTC)