Hello Alban,
The instructions of specific interest areLDHX opr8a andSTHX opr8a since my query pertains to I/O registers.
The reference manual tells me that the LDHX instruction uses two read cycles, and the STHX instruction uses two write cycles. However, the manual does not indicate (except for the STHX case, as previously covered) which read/write cycle is for H, and which cycle is for X. Additionally, the manual is for the HCS08 - I am not sure I can assume the HC908 would be the same since there are differences in many instruction cycles.
For the HC908 devices, whether or not these instructions can be utilised for the reading or writing of certain word registers requires that the high byte (H) be read or written first, followed by the low byte (X). So the byte sequence is very important for these cases. The word registers that have these requirements are -
ADC10 module:
ADR requires sequenced reading of 10-bit value.
TIM module:
TMOD requires sequenced write.
TCNT requires sequenced read.
TCHx register for each channel requires sequenced read for IC mode, and sequenced write for OC and PWM modes.
It has been established that the write sequence for STHX is correct, but the read sequence for LDHX still remains uncertain.
Regards,
Mac