Difference between revisions of "OSBYTE &93"

From BeebWiki
Jump to: navigation, search
(reinstate warning (see Talk:OSBYTE &97))
m (link maintenance)
 
(7 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
     X=offset within page &FC and Y=byte to write
 
     X=offset within page &FC and Y=byte to write
  
'''Warning:''' Acorn MOS 1.20 writes the byte using STA &FC00,X. As it is an indexed-addressing instruction, the 6502 CPU (always) performs a dummy read immediately before the write. Some hardware, though not all, may operate inappropriately due to the dummy read: outputs could momentarily be set to the wrong level, or an interrupt condition could be cleared and lost. Review the datasheet for the hardware being accessed to see whether it will be adversely affected.
+
;Warning
 +
 
 +
Acorn MOS 1.20 writes the byte using STA &FC00,X. As it is an indexed-addressing instruction, the 6502 CPU always<!-- ref name="65xxprog">MOS Technology, Inc. (January 1976), [http://6502.org/documents/books/mcs6500_family_programming_manual.pdf MCS6500 Microcomputer Family Programming Manual], appendix B, p.B-26 (PDF p.228)</ref --><ref name="65xxhw">MOS Technology, Inc. (January 1976), [http://6502.org/documents/books/mcs6500_family_hardware_manual.pdf MCS6500 Microcomputer Family Hardware Manual], appendix A, section A.3.4, p.A-6 (PDF p.173)</ref><ref name="64doc">Jarkko Sonninen ''et al.'' (1994), [https://archive.retro-kit.co.uk/bbc.nvg.org/doc/6502.txt 64doc]</ref> performs a dummy read immediately before the write. Some hardware, though not all, may operate inappropriately due to the dummy read: outputs could momentarily be set to the wrong level, or an interrupt condition could be cleared and lost. Review the datasheet for the hardware being accessed to see whether it will be adversely affected.
  
 
A safer alternative is to call [[OSWORD &06]] with !XY=&FFFFFC00 + offset, XY?4=byte.
 
A safer alternative is to call [[OSWORD &06]] with !XY=&FFFFFC00 + offset, XY?4=byte.
Line 12: Line 14:
  
 
[[User:Jgharston|Jgharston]] 22:04, 26 May 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 22:04, 26 May 2009 (UTC)
 +
 +
==References==
 +
<references/>

Latest revision as of 13:18, 19 August 2022

OSBYTE &93 (147) - Write FRED

   X=offset within page &FC and Y=byte to write
Warning

Acorn MOS 1.20 writes the byte using STA &FC00,X. As it is an indexed-addressing instruction, the 6502 CPU always[1][2] performs a dummy read immediately before the write. Some hardware, though not all, may operate inappropriately due to the dummy read: outputs could momentarily be set to the wrong level, or an interrupt condition could be cleared and lost. Review the datasheet for the hardware being accessed to see whether it will be adversely affected.

A safer alternative is to call OSWORD &06 with !XY=&FFFFFC00 + offset, XY?4=byte.

See Also

Jgharston 22:04, 26 May 2009 (UTC)

References

  1. MOS Technology, Inc. (January 1976), MCS6500 Microcomputer Family Hardware Manual, appendix A, section A.3.4, p.A-6 (PDF p.173)
  2. Jarkko Sonninen et al. (1994), 64doc