HOME

TheInfoList



OR:

In computer engineering, Halt and Catch Fire, known by the assembly mnemonic HCF, is an
idiom An idiom is a phrase or expression that typically presents a figurative, non-literal meaning attached to the phrase; but some phrases become figurative idioms while retaining the literal meaning of the phrase. Categorized as formulaic language, ...
referring to a computer
machine code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ver ...
instruction that causes the computer's
central processing unit A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, an ...
(CPU) to cease meaningful operation, typically requiring a restart of the computer. It originally referred to a fictitious instruction in
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
computers (introduced in 1964), making a joke about its numerous non-obvious instruction mnemonics. With the advent of the MC6800 (introduced in 1974), a design flaw was discovered by programmers. Due to incomplete opcode decoding, two
illegal opcode An illegal opcode, also called an unimplemented operation, unintended opcode or undocumented instruction, is an instruction to a CPU that is not mentioned in any official documentation released by the CPU's designer or manufacturer, which ne ...
s, 0x9D and 0xDD, will cause the
program counter The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, is ...
on the processor to increment endlessly, which locks the processor until reset. Those codes have been unofficially named HCF. During the design process of the MC6802, engineers originally planned to remove this instruction, but kept it as-is for testing purposes. As a result, HCF was officially recognized as a real instruction. Later, HCF became a humorous catch-all term for instructions that may freeze a processor, including intentional instructions for testing purposes, and unintentional illegal instructions. Some are considered hardware defects, and if the system is shared, a malicious user can execute it to launch a
denial-of-service attack In computing, a denial-of-service attack (DoS attack) is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host conn ...
. In the case of real instructions, the implication of this expression is that, whereas in most cases in which a CPU executes an unintended instruction (a bug in the code) the computer may still be able to recover, in the case of an HCF instruction there is, by definition, no way for the system to recover without a restart. The expression ''catch fire'' is a facetious exaggeration of the speed with which the CPU chip would be switching some bus circuits, causing them to overheat and burn.


Origins

The Z1 (1938) and Z3 (1941) computers built by
Konrad Zuse Konrad Ernst Otto Zuse (; 22 June 1910 – 18 December 1995) was a German civil engineer, pioneering computer scientist, inventor and businessman. His greatest achievement was the world's first programmable computer; the functional program- ...
contained illegal sequences of instructions which damaged the hardware if executed by accident. Apocryphal stories connect this term with an
illegal opcode An illegal opcode, also called an unimplemented operation, unintended opcode or undocumented instruction, is an instruction to a CPU that is not mentioned in any official documentation released by the CPU's designer or manufacturer, which ne ...
in
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
. A processor, upon encountering the instruction, would start switching
bus lines A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle that carries significantly more passengers than an average car or van. It is most commonly used in public transport, but is also in use for char ...
very fast, potentially leading to overheating. In a computer's assembly language, mnemonics are used that are directly equivalent to
machine code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ver ...
instructions. The mnemonics are frequently three letters long, such as ADD, CMP (to compare two numbers), and JMP (jump to a different location in the program). The HCF instruction was originally a fictitious assembly language instruction, said to be under development at IBM for use in their
System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
computers, along with many other amusing
three-letter acronym A three-letter acronym (TLA), or three-letter abbreviation, is an abbreviation consisting of three letters. These are usually the initial letters of the words of the phrase abbreviated, and are written in capital letters (upper case); three-lette ...
s like XPR (Execute Programmer) and CAI (Corrupt Accounting Information), and similar to other joke mnemonics such as "SDI" for "Self Destruct Immediately" and "CRN" for "Convert to Roman Numerals". A list of such mnemonics, including HCF, shows up as "Overextended Mnemonics" in the April 1980 ''
Creative Computing ''Creative Computing'' was one of the earliest magazines covering the microcomputer revolution. Published from October 1974 until December 1985, the magazine covered the spectrum of hobbyist/home/personal computing in a more accessible format th ...
'' flip-side parody issue. The
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
already included numerous non-obvious mnemonics like ZAP (Zero and Add Packed), EDMK (EDit and MarK), TRT (TRanslate and Test), and Read Backward (an I/O channel command), and programmers began creating similarly cryptic, but fictitious, instructions in a humorous vein. In a 1990
USENET Usenet () is a worldwide distributed discussion system available on computers. It was developed from the general-purpose Unix-to-Unix Copy (UUCP) dial-up network architecture. Tom Truscott and Jim Ellis conceived the idea in 1979, and it was ...
discussion, it was claimed that HCF dated back to before 1977. In Rick Cook's science fiction/fantasy novel, ''The Wizardry Compiled'', about programmers transported to a universe where magic could be programmed, one of them refers to the command as HMCF, for "Halt, Melt and Catch Fire". In ''
TIS-100 ''TIS-100'' is a programming/puzzle video game developed by Zachtronics Industries. The game has the player develop mock assembly language code to perform certain tasks on a fictional, virtualized 1970s computer that has been corrupted. The ga ...
'', a 2015 puzzle video game made by
Zachtronics Zachtronics LLC is an American indie video game studio, best known for their engineering puzzle games and programming games. Zachtronics was founded by Zach Barth in 2000, who serves as its lead designer. Some of their products include '' SpaceC ...
, there is an achievement called HALT_AND_CATCH_FIRE for crashing the machine with a hidden opcode.


In modern CPUs

CPU designers sometimes incorporate one or more undocumented machine code instructions for testing purposes, such as the IBM System/360 DIAGnose instruction.


Motorola 6800

The
Motorola 6800 The 6800 ("''sixty-eight hundred''") is an 8-bit microprocessor designed and first manufactured by Motorola in 1974. The MC6800 microprocessor was part of the M6800 Microcomputer System (latter dubbed ''68xx'') that also included serial and paral ...
microprocessor A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circu ...
was the first for which an undocumented assembly mnemonic HCF became widely known. The operation codes (
opcode In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the opera ...
s—the portions of the machine language instructions that specify an operation to be performed) are hexadecimal 9D and DD, and were reported and given the unofficial mnemonic HCF in an article written by Gerry Wheeler in the December 1977 issue of ''BYTE'' magazine on undocumented opcodes. Wheeler noted that Motorola reported 197 valid operation codes for the M6800 processor, and so inferred that with 256 possible 8 bit combinations, there must be 59 "invalid instructions". He goes on to describe the HCF as a "big surprise", and saying of the Catch Fire portion of the moniker, "Well, almost": The process is reviewed by David Agans, thus: That is, either opcode made the processor enter a mode, continuously performing
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered ...
read cycles from successive
address An address is a collection of information, presented in a mostly fixed format, used to give the location of a building, apartment, or other structure or a plot of land, generally using political boundaries and street names as references, along ...
es with no intervening instruction fetches. Hence, the
address bus In computer architecture, a bus (shortened form of the Latin ''omnibus'', and historically also called data highway or databus) is a communication system that transfers data between components inside a computer, or between computers. This ex ...
effectively became a
counter Counter may refer to: Mathematics and computing * Counter machine, a subclass of register machines * Counter (digital), an electronic device, mechanical device, or computer program for counting * Loop counter, the variable that controls the iterat ...
, allowing the operation of all
address lines An address is a collection of information, presented in a mostly fixed format, used to give the location of a building, apartment, or other structure or a plot of land, generally using political boundaries and street names as references, along ...
to be quickly verified. Once the processor entered this mode, it was not responsive to
interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
s, so normal operation could only be restored by a reset (hence the "Drop Dead" and "Halt and Catch Fire" monikers). These references were thus to the unresponsive behavior of the CPU in this state, and not to any form of erratic behavior. Other HCF-like instructions were found later on the Motorola 6800 when executing undocumented opcodes FD (cycling twice slower than 9D/DD) or CD/ED (cycling at a human-readable very low frequency on a limited number of high-address lines). The mnemonic HCF is believed to be the first built-in self-test feature on a Motorola microprocessor.


Intel x86

The Intel 8086 and subsequent processors in the x86 series had an HLT (halt) instruction, opcode 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 Intel DX4 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 kernel 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. The 80286 has the undocumented opcode 0F