Halt and catch fire: Difference between revisions
(Added Algol W) |
(Added Algol 68) |
||
Line 9: | Line 9: | ||
# [https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing) Halt and Catch Fire] |
# [https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing) Halt and Catch Fire] |
||
<br><br> |
<br><br> |
||
=={{header|ALGOL 68}}== |
|||
This program will crash immediately on startup. |
|||
<lang algol68>( print( ( 1 OVER 0 ) ) )</lang> |
|||
=={{header|ALGOL W}}== |
=={{header|ALGOL W}}== |
Revision as of 21:14, 12 September 2021
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
ALGOL 68
This program will crash immediately on startup. <lang algol68>( print( ( 1 OVER 0 ) ) )</lang>
ALGOL W
This won't halt the CPU but the program will crash immediately on startup. <lang algolw>assert false.</lang>
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
Disabling interrupts prior to a HLT
command will cause the CPU to wait forever.
<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>
REXX
<lang rexx>=</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>