Talk:OSBYTE &95

From BeebWiki
Revision as of 19:31, 28 August 2015 by Jgharston (talk | contribs) (Created page with "==Bug in indexed addressing== This article originally had a version of the following warning: Acorn MOS 1.20 writes the byte using STA &FD00,X. As it is an indexed-addressin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Bug in indexed addressing

This article originally had a version of the following warning:

Acorn MOS 1.20 writes the byte using STA &FD00,X. As it is an indexed-addressing instruction, the 6502 CPU 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.

However, the indexed addressing mode bug only manifests if the calculated address crosses a page boundary from the base address. For instance, STA &FCF0,X where X=16 crosses from page &FC to page &FD to read the byte at &FCF0+16=&FD00. (What happens in this case is that &FC00 is erroneously read and then &FD00 is written.) As all the 'read/write I/O' OSBYTEs index from &xx00 they will never cross a page boundary, so the bug will not manifest.