On real hardware pressing Start or Clear on the console will clear all I/O device flags. On Omnibus machines this could also be accomplished by executing the CAF instruction. In this regard SIMH behaves like real hardware in that when it wakes up all device flags are clear.
If the I/O flags are clear, then this code will hang.
This happens because you are waiting for an event that will never occur. The flag can never become true because you have never sent a character. This confusion was common among early assembly coders. My instructor just did the TLS;TSF;JMP .-1 sequence because he knew that worked. Everyone eventually wants to do it the other way because it is more efficient. It lets you take advantage of the time between the TLS and the time to send the character. At 110 baud this time is considerable (~100 ms). On the high speed punch you can hear a difference. It does not run quite as smoothly.
The reason to treat the flags this way is because of interrupts. If the machine wakes up with the flag set, an interrupt will occur as soon as they are enabled. The interrupt routine will discover a TTY output interrupt is pending and dispatch to the TTY out routine. This would clear the interrupt with a TCF. At this point the output buffer would be checked and since there are no characters in the buffer it will return from the interrupt having wasted that time. If the machine wakes up with the flag clear, no interrupt occurs.
I have seen code that gets around this issue by sending a null right after the program starts running. Changing your program in this way.
Code:
HELLO, CLA CLL / Clear the AC and the Link bit
TLS / PRIME THE PUMP BY SENDING A NULL
TAD (DATA-1) / Point at AC just "BEFORE" the data (accounting for later pre-increment behavior)
...
OUT1, 0 / Will be replaced by caller's updated PC
TSF / Skip if the previous character is done
JMP .-1 / Wait for flag
TLS / Send the character in the AC
CLA CLL / Clear AC and Link for the next pass
JMP I OUT1 / Return to caller
I am guessing that this is what you are doing in your OUT1 output routine and why it doesn't work on a fresh start of SIMH.
I always disliked this fix because the teletype makes an additional jiggle of the mechanism.
Kudos on your usage of the Auto index register. It is a seldom used feature of the machine.
You can compress your ASCII string to a single line like this:
Code:
DATA, "H;"e;"l;"l;"o;",;" ;"W;"o;"r;"l;"d;"!;015;012;0
I know that it is ugly either way.
I don't use SIMH often as I wrote my own Straight 8 emulator starting in the mid 1980's. Interestingly a 386 at 16 mhz runs the emulator about the same speed as real hardware.
I hope that helps and Best Wishes!