Halt and catch fire: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
Line 15: Line 15:


=={{header|8086 Assembly}}==
=={{header|8086 Assembly}}==
{{trans|Z80 Assembly}}==
{{trans|Z80 Assembly}}
These two lines will halt the processor:
These two lines will halt the processor:
<lang asm>cli
<lang asm>cli
hlt</lang>
hlt</lang>

=={{header|68000 Assembly}}==
=={{header|68000 Assembly}}==
The 68000 can only read words or longs at even addresses. Attempting to do so at an odd address will crash the CPU.
The 68000 can only read words or longs at even addresses. Attempting to do so at an odd address will crash the CPU.

Revision as of 20:27, 12 September 2021

Task
Halt and catch fire
You are encouraged to solve this task according to the task description, using any language you may know.
Task

Create a program that crashes as soon as possible, with as few lines of code as possible. Be smart and don't damage your computer, ok?

References
  1. Halt and Catch Fire



6502 Assembly

Upon executing this byte as code, the processor will halt. No interrupts can occur either. This does not occur on 65c02-based hardware such as the Apple II or Atari Lynx. <lang 6502asm> db $02</lang>

8086 Assembly

Translation of: Z80 Assembly

These two lines will halt the processor: <lang asm>cli hlt</lang>

68000 Assembly

The 68000 can only read words or longs at even addresses. Attempting to do so at an odd address will crash the CPU. <lang 68000devpac>CrashBandicoot equ $100001 LEA CrashBandicoot,A0 MOVE.W (A0),D0</lang>

Z80 Assembly

The processor is permanently halted. Strangely enough, this does not work on the Game Boy. Rather, both the HALT instruction and the instruction after it are skipped. <lang z80>di halt</lang>