7 ms·
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 -
by pifm_guy 4y 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?
- billforsternz 4y ago1976 not 1970, in 1970 a CPU as advanced as the 8086 was science fiction (things were moving fast back then).
- tadfisher 4y agoYeah, in 1970 the first mass-manufactured integrated circuits were flying to/landing on the Moon. The pace of technology back then was unreal.
- kens 4y agoYes, 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.
- flohofwoe 4y agoOn 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).
- caf 4y agoI 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.
- bonzini 4y agoYes, 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.