Halt and Catch Fire, known by the assembly mnemonic HCF, refers to several computer machine
code instructions that cause a computer's CPU to cease meaningful operation.
The expression "catch fire" is intended as a joke; the CPU does not literally catch fire,
but it does stop functioning.
It is also occasionally referred to as "SDI" for "Self Destruct Immediate".
In early CPUs In a computer's assembly language, mnemonics
are used that are directly equivalent to machine code instructions.
The mnemonics are frequently three letters long, such as ADD, CMP, and JMP.
The HCF instruction was originally a fictitious assembly language instruction, said to be
under development at IBM for use in their System/360 computers, along with many other
amusing instructions like XPR and CAI.
The S/360 instruction set already included numerous complex and non-obvious operations
like ZAP, EDMK, TRT, and Read Backward, so programmers humorously proposed creating more
like them.
One apocryphal story about the HCF instruction goes back to the late 1960s, when computers
used magnetic core memory.
The story goes that in order to speed up the core memory on their next model the engineers
increased the read/write currents in the very fine wires that were threaded through the
cores.
This worked fine when the computer was executing normal programs, since memory accesses were
spread throughout memory.
However, the HALT instruction was implemented as a "Jump to self".
This meant that the same core memory location was repeatedly accessed, and the very fine
wires became so hot that they started to smoke — hence the instruction was labeled "Halt
and Catch Fire".
In modern CPUs CPU designers sometimes incorporate one or
more undocumented machine code instructions for testing purposes.
These instructions are not intended to be executed during normal operation of the CPU
and when they are actually executed by a program, they often have unusual side-effects.
The old "Halt and Catch Fire" instruction and HCF mnemonic are sometimes appropriated
by users who discover these instructions as a humorous way of expressing that the unintended
execution of such an instruction causes the system to fail to perform its normal functions.
Motorola 6800 The Motorola 6800 microprocessor was the first
for which an HCF opcode became widely known.
The 6800 HCF opcodes are $9D and $DD and were reported in an article written by Gerry Wheeler
in the December 1977 issue of BYTE magazine on undocumented opcodes.
The opcode makes the processor enter a mode in which it continuously performs memory read
cycles from successive addresses, with no intervening instruction fetches.
The address bus effectively becomes a counter, allowing the operation of all address lines
to be quickly verified.
Once the processor has entered this mode, it is not responsive to interrupts, so normal
operation can only be restored by a reset.
Some engineers began referring to the operation as "Halt and Catch Fire".
It has been claimed that in some hardware configurations, the unrelenting driving of
the address lines caused them to smoke or burn.
It is likely that the term "catch fire" is intended more as a metaphor for the unresponsive
behavior of the CPU when placed in this state; there are no known examples of erratic behavior.
The HCF opcode is believed to be the first built-in self-test feature on a Motorola microprocessor.
The opcode is also present on the 6809.
Intel x86
The Intel 8086 and subsequent processors in the x86 series had an HLT instruction, op
code F4, which stopped instruction execution and placed the processor in a HALT state.
An enabled interrupt, a debug exception, the BINIT signal, the INIT signal, or the RESET
signal resumed execution, which meant the processor could always be restarted.
Some of the early i486DX-100 chips had a problem with the HLT instruction, and could not be
restarted after this instruction was used, which disabled the computer and turned HLT
into more of an HCF instruction.
The Linux operating system added a 'no-hlt' option telling Linux to run an infinite loop
instead of using HLT, which allowed users of these broken chips to use Linux.
Many computers in the Intel Pentium line could be locked up by executing an invalid instruction
which caused the computer to try to execute the invalid F00F instruction and then lock
up.
This became known as the Pentium F00F bug.
No compiler would create the instruction, but hackers could insert it in code through
devious means to crash file and communications servers.
Since the computer was not damaged by the event and could be restarted with the RESET
switch it was not a true HCF instruction, although it could cause data loss.
Since it has been discovered, workarounds have been developed to prevent it from locking
the computer, and the bug has been fixed in subsequent Intel processors.
See also Cyrix coma bug
Killer poke Lp0 on fire
Pentium F00F bug Write-only memory
References
External links Jargon File/New Hacker's Dictionary entry
for Halt and Catch Fire