Amstrad CPC Basic, 7 keypresses.
Amstrad CPC cannot be physically shut down by software, but system can be reset with this BASIC call:
call 0
How it works
General info
At the beginning of memory (either RAM or ROM, both are prepared for this), there is a table for Z80 RST
instruction. These instructions, related to Z80 interrupt handling, are also used (even on machines other than Amstrad CPC, like TI-81) for other tricks because one-byte long assembly instruction is enough to reach any of the 8 entries.
On the Amstrad CPC they are used to space-efficiently call code in ROM, RAM, expansion RAM/ROM, see BIOS Function Summary - CPCWiki or ref page 8+. This is used extensively to make RAM-based indirections that allow easily calling ROM routines from RAM (even from BASIC, like call &bd19
that waits for screen refresh) and also, by changing them, modifying system behavior even though system is in ROM (like changing how text is displayed, or even redirecting it to printer by changing two bytes of RAM). See BB00
and following in BIOS Function Summary - CPCWiki or Firmware Guide
Specific use
Entry zero jumps to a ROM-base routine that performs full machine reset. The simplest way to call it from BASIC it call 0
.
Variant
If you insist on a program that can be run rather than a direct command, it takes 8 keypresses:
1call 0
Then you can run
.
Can I haz test?
You can test at once on CPCBox - Amstrad CPC emulator in Javascript.
`whatever`;
Bash/Perl/PHP/Ruby/etc. stupiglots. \$\endgroup\$ – manatwork Jan 24 '17 at 14:22shatdown: past tense of the verb shutdown
\$\endgroup\$ – FGreg Jan 24 '17 at 17:34