Difference between revisions of "OSWRSC"

From BeebWiki
Jump to: navigation, search
m (1 revision)
m (Updated BASIC code to zero Y%.)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:MOS API]]
+
[[Category:MOS API]]__NOTOC__
 
Writes a byte to screen.
 
Writes a byte to screen.
  
Line 6: Line 6:
 
| colspan="2" | '''On entry:'''
 
| colspan="2" | '''On entry:'''
 
|-
 
|-
| valign="top" | ?&D6 || = LSB of address to be read
+
| valign="top" | ?&D6 || = LSB of base address to be written
 
|-
 
|-
| valign="top" | ?&D7 || = MSB of address to be read
+
| valign="top" | ?&D7 || = MSB of base address to be written
 
|-
 
|-
 
| valign="top" |  A  || = Byte to be written
 
| valign="top" |  A  || = Byte to be written
 +
|-
 +
| valign="top" |  Y  || = Offset from base address
 
|}
 
|}
  
Line 21: Line 23:
 
|}
 
|}
  
Stores a byte in an address the current display memory (in main or [[shadow
+
Stores a byte in an address the current display memory (in main or
RAM]]). The address to be written to is given in locations &D6 (low byte)
+
[[shadow RAM]]). The address to be written to is given in locations &D6 (low
and &D7 (high byte), and byte to be written is passed in A. Although this
+
byte) and &D7 (high byte) ''plus Y'', and byte to be written is passed in A.
call is the complement of [[OSRDSC]] which is able to read from sideways
+
In other words, OSWRSC acts like STA (&D6),Y but accessing screen RAM (and
ROMs, this call only writes to the currently displayed memory and the
+
affecting the flags). Although this call is the complement of [[OSRDSC]]
currently selected sideways RAM bank.
+
which is able to read from sideways ROMs, this call only writes to the
 +
currently displayed memory and the currently selected sideways RAM bank.
  
 
Also note that the address is passed in a different location to OSRDSC.
 
Also note that the address is passed in a different location to OSRDSC.
Line 44: Line 47:
  
 
==Implementations==
 
==Implementations==
The call was introduced in MOS 2.00, and is absent in earlier versions. It
+
The call was introduced in MOS 2.00, and is absent in earlier versions.
is not implemented on non-6502 platforms and BBC BASIC does not emulate its
+
In MOS 2.00 calls write to the currently displayed screen memory. On the
entry point.
+
Master series the call writes to whichever screen memory is being accessed
 +
by the VDU.
 +
 
 +
OSWRSC is not implemented on non-6502 platforms and BBC BASIC does not
 +
emulate its entry point.
 +
 
 +
==Coding==
 +
The function FNwm(), if used on the I/O processor, will write a byte to
 +
screen or main memory.
 +
 
 +
    DEFPROCwm(!&D6,A%):LOCAL Y%:IF!&D6<0:IF?&D8=&FE:CALL&FFB3:ENDPROC ELSE ?!D6=A%:ENDPROC
 +
 
 +
If the passed address is &FFFExxxx it writes to the currently displayed screen
 +
memory, otherwise it writes to main memory.
  
[[User:Jgharston|Jgharston]] 17:49, 12 December 2007 (UTC)
+
-- [[User:Beardo|beardo]] 23:20, 5 October 2007 (BST)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 04:26, 29 March 2015 (UTC)

Latest revision as of 10:08, 16 March 2021

Writes a byte to screen.

Specification

On entry:
 ?&D6 = LSB of base address to be written
 ?&D7 = MSB of base address to be written
A = Byte to be written
Y = Offset from base address
On exit:
A,X,Y = preserved
C undefined

Stores a byte in an address the current display memory (in main or shadow RAM). The address to be written to is given in locations &D6 (low byte) and &D7 (high byte) plus Y, and byte to be written is passed in A. In other words, OSWRSC acts like STA (&D6),Y but accessing screen RAM (and affecting the flags). Although this call is the complement of OSRDSC which is able to read from sideways ROMs, this call only writes to the currently displayed memory and the currently selected sideways RAM bank.

Also note that the address is passed in a different location to OSRDSC.

Calling from BBC BASIC

  • BASIC does not call OSRDSC

Entry points

  • BBC BASIC Entry Address: none
  • 6502 Entry Address: &FFB3
  • Z80 Entry Address: none
  • 6809 Entry Address:
  • 80x86 Entry Address: none
  • 32000 Entry Address: none
  • PDP-11 Entry Address: none
  • ARM Entry Address: none

Implementations

The call was introduced in MOS 2.00, and is absent in earlier versions. In MOS 2.00 calls write to the currently displayed screen memory. On the Master series the call writes to whichever screen memory is being accessed by the VDU.

OSWRSC is not implemented on non-6502 platforms and BBC BASIC does not emulate its entry point.

Coding

The function FNwm(), if used on the I/O processor, will write a byte to screen or main memory.

   DEFPROCwm(!&D6,A%):LOCAL Y%:IF!&D6<0:IF?&D8=&FE:CALL&FFB3:ENDPROC ELSE ?!D6=A%:ENDPROC

If the passed address is &FFFExxxx it writes to the currently displayed screen memory, otherwise it writes to main memory.

-- beardo 23:20, 5 October 2007 (BST) Jgharston (talk) 04:26, 29 March 2015 (UTC)