Hacker News new | ask | show | jobs
by pifm_guy 1235 days ago
So why didn't they implement the HLT instruction as simply a 'jump to self' infinite loop?

Then no special logic would be needed, no extra states, etc.

Sure - there would be no power savings, and the memory bus wouldn't be idle, but we're either of those a requirement in 1970?

3 comments

Yes, halt is sort of redundant and processors like the 6502 omitted it. I think the historical popularity of halt was because you could indicate to the operator that the computer was halted, rather than in an infinite loop. Peripheral devices could also detect the halt state.
On Z80 home computers, HALT was often used to synchronise some piece of code with a hardware interrupt like VSYNC for 'race-the-beam' stuff (because an interrupt takes the CPU out of the HALT state).
I believe by the time the processor has halted, the IP has advanced, so when the interrupt returns it will resume executing after the HLT. An infinite loop would resume executing the loop.
Yes, and by issuing STI followed by HLT you can ensure that the after the interrupt returns the IP is always pointing past HLT. I think this is a feature that Intel had to patch because they got it wrong in the first steppings.
1976 not 1970, in 1970 a CPU as advanced as the 8086 was science fiction (things were moving fast back then).
Yeah, in 1970 the first mass-manufactured integrated circuits were flying to/landing on the Moon. The pace of technology back then was unreal.