Hi Edward,
It doesn't matter whether you post it here or create a ticket.
But in this case, it doesn't seem to be a bug.
I tried the code you posted right in the _Startup function like this on S12ZVCA19 devkit
__EXTERN_C void _Startup(void) {
__asm{
CLR D2
rdlp: INC D2
BRCLR.B ECCSTAT, #0, rdlp
ST D2, 0x3000 // save loop count
}
__asm{
LD S, #__SEG_END_SSTACK-1 /* initialize SP */
#ifdef __ALIGN_STACK_OPT__
TFR S, D6 /* align SP to 4*/
AND D6, #-4
TFR D6, S
#endif
}
DoZeroOut();
DoCopyDown();
#ifdef __cplusplus
__static_init();
#endif
main();
}
The counter showed 0x70.

But if the code is modified to write the SRAM while RDY == 0, the execution stalls at the ST instruction and the SRAM is written once the SRAM has become ready.
__EXTERN_C void _Startup(void) {
__asm{
CLR D2
rdlp: INC D2
ST D2, 0x3000 // save loop count
BRCLR.B ECCSTAT, #0, rdlp
}
__asm {
LD S, #__SEG_END_SSTACK-1 /* initialize SP */
#ifdef __ALIGN_STACK_OPT__
TFR S, D6 /* align SP to 4*/
AND D6, #-4
TFR D6, S
#endif
}
DoZeroOut();
DoCopyDown();
#ifdef __cplusplus
__static_init();
#endif
main();
}

Regards,
Daniel