Below is a snip of the code from SPC2ROM's Player.s source file:
My concern is with the 16-bit operation "StA 2140h which writes the value #$01CC to both $2140 and $2141 with a single instruction. I had read somewhere that you were not supposed to use 16-bit operations to write to those ports because it could inadvertently cause the value at $2143 to become corrupted (due to switching noise on the B address bus)....? Is this not true? Has someone confirmed that it doesn't actually matter?
Code:
;16-bit Accumulator
A16 MACRO
ON16A ; jwdonal - this does nothing as far as I can tell.
; It is not a macro and it doesn't cause any code to be generated.
ReP #20h
ENDM
;8-bit Accumulator
A8 MACRO
OFF16A ; jwdonal - this does nothing as far as I can tell.
; It is not a macro and it doesn't cause any code to be generated.
SeP #20h
ENDM
.................<snip>.....................
;==============
;Transfer SPC700 program
;Wait for SPC700 to initialize -------------
A16
Init:
LdA #0BBAAh
_Wait:
Cmp 2140h
BNE _Wait
;Initialize transfer -----------------------
LdA #02h ;Store destination address
StA 2142h
LdA #1CCh ;Tell SPC700 we're ready to start
Trans:
StA 2140h
A8
_Wait:
Cmp 2140h
BNE _Wait
A16 MACRO
ON16A ; jwdonal - this does nothing as far as I can tell.
; It is not a macro and it doesn't cause any code to be generated.
ReP #20h
ENDM
;8-bit Accumulator
A8 MACRO
OFF16A ; jwdonal - this does nothing as far as I can tell.
; It is not a macro and it doesn't cause any code to be generated.
SeP #20h
ENDM
.................<snip>.....................
;==============
;Transfer SPC700 program
;Wait for SPC700 to initialize -------------
A16
Init:
LdA #0BBAAh
_Wait:
Cmp 2140h
BNE _Wait
;Initialize transfer -----------------------
LdA #02h ;Store destination address
StA 2142h
LdA #1CCh ;Tell SPC700 we're ready to start
Trans:
StA 2140h
A8
_Wait:
Cmp 2140h
BNE _Wait
My concern is with the 16-bit operation "StA 2140h which writes the value #$01CC to both $2140 and $2141 with a single instruction. I had read somewhere that you were not supposed to use 16-bit operations to write to those ports because it could inadvertently cause the value at $2143 to become corrupted (due to switching noise on the B address bus)....? Is this not true? Has someone confirmed that it doesn't actually matter?