Talk:OSBYTE &93

From BeebWiki
Jump to: navigation, search

Bug in indexed addressing

This article originally had the following warning:

Acorn MOS 1.20 writes the byte using STA &FC00,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.

Permanent dummy read confirmed; see Talk:OSBYTE &97. Regregex (talk) 17:09, 18 April 2016 (UTC)