Hmm ...
at first it looks like an obvious typo in the PRM. If one masks out 64 from an integer value, the result can only be 0 or 64, therefore this comparison always fails. OTOH, in register 37151, neither bit 0 (value: 1) nor bit 6 (value: 64) are related to RS232.
...
Ah! We had this discussed some time ago here: '
Userport Serial programming nonsense'.
...
I dug a bit in the KERNAL. There are two byte pointers into the RS232 transmit buffer, $029D ("one after byte just sent") and $029E ("next free place"). When these two are equal, the KERNAL disables the NMI timer for output instead of transferring the next byte into the byte output buffer. Thus you might try:
to check for an empty transmit buffer.
Greetings,
Michael