OSWORD &B2

From BeebWiki
Jump to: navigation, search

OSWORD &B2 (178) - Advanced BASIC (BASIC V) support AdvBASIC

This call is used to support 6502 BASIC V on the 6502 second
processor.
On entry:
 XY?0=send length
 XY?1=receive length
 XY?2=command
 XY+3.. additional information
Commands in are:
&00 - Read EDIT/ROM values
On entry:
 XY?0=3 (send length)
 XY?1=3 (receive length)
 XY?2=0
On exit:
 XY?0=current EDITO value OR &80 or <&80 if BASIC V not
  present
 XY?1 Advanced BAISC ROM number
 XY?2 HIEDIT/EDIT flag (0 or 2)
&01-&7F - Fetch overlay
On entry:
 XY?0=3 (send length)
 XY?1=128 (receive length)
 XY?2=overlay number
On exit:
 Overlay 1 to &7F is returned in the control block
&80 - Convert SWI string to number
On entry:
 XY?0=4+length of string (send length)
 XY?1=5 (receive length)
 XY?2=&80
 XY+3=CR-terminated string to match with leading "OS_"
  removed.
On exit:
 XY!0=SWI number
 XY?4=reault, &00=matched, &FF=unknown
&81 - Convert SWI number to string
On entry:
 XY?0=7 (send length)
 XY?1=32 (receive length)
 XY?2=&81
 XY!3=SWI number
On exit:
 XY+0.. unterminated SWI string, including starting "OS_"
 XY?31=string length or >&7F if unknown
&82 - HELP
On entry:
 XY?0=128 (send length)
 XY?1=0 (receive length)
 XY?2=&82
 XY+3..127 should contain a copy of BASIC's workspace
  from &0000 to &007C.
On exit:
 The call outputs information to OSWRCH. The control block
 is unchanged.
&83 - HELP <keyword>
On entry:
 XY?0=128 (send length)
 XY?1=0 (receive length)
 XY?2=&83
 XY+3..127=CR-terminated tokenised string following HELP.
On exit:
 The call accesses the BASHELP file and outputs information
 to OSWRCH. The control block is unchanged.
&84 - HELP . (dot)
On entry:
 XY?0=3 (send length)
 XY?1=0 (receive length)
 XY?2=&84
On exit:
 Similar to &83, except no help string required, and whole
 help file is output.
&85 - CALL or USR in I/O memory
On entry:
 XY?0=11 (send length)
 XY?1=11 (receive length)
 XY?2=&85
 XY?3=A register
 XY?4=X register
 XY?5=Y register
 XY?6=P register (only Cy valid)
 XY!7=address
On exit:
 XY!3=AXYP returned from called code.
If the address if &FFrrxxxx, then ROM rr will be called, otherwise
the current language ROM will be paged in.
&86-&FF - reserved.

See Also

Jgharston 14:21, 26 May 2009 (UTC)