Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

assembly - 65(C)02 Will indexed zero page addressing cross page boundary?

I'm building an emulator for the 6502 and 65C02 and I don't have the actual chip (yet).
I tried looking this up in the datasheet but it doesn't say what will happen when this occurs:

LDA #$FF    ; 0xFF -> A
LDX #$20    ; 0x20 -> X

STA #$F4, X
; A -> M[0x00F4 + X]
; A -> M[0x00F4 + 0x20]
; A -> M[0x0114] ?
; OR
; A -> M[(0x00F4 + X) & 0x00FF]
; A -> M[(0x00F4 + 0x20) & 0x00FF]
; A -> M[0x0114 & 0x00FF]
; A -> M[0x0014] ?

STA with a single byte address will store the result in the zero page. But if the offset crosses the page boundary, will it be written to the next page over (stack) or will it stay on the zero page and wrap around?

Is it the same behavior for the 6502 NMOS and 65C02 CMOS?

Will the page boundary cross for the zero page add an additional clock cycle as it does for absolute addressing modes with indexing?

question from:https://stackoverflow.com/questions/65940159/65c02-will-indexed-zero-page-addressing-cross-page-boundary

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No. The carry during the addition of the index will not be used.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...