这个问题在这里已经有了答案:
How to power down the computer from a freestanding environment?
(2 个回答)
3年前关闭。
汇编中的 hlt 指令可以在停止处理器时关闭计算机吗?如果可以使用我所说的来完成,这是正确的方法吗?
hlt 可以关闭机器吗?
start:
xor ax, ax; ;clear ax
mov bx, ax; ;clear bx
cli ;stop all interrupts
hlt ;halt the cpu
如果这不是要完成的方法,如果这不会关闭系统,请告诉我正确的方法。
最佳答案
hlt
指令停止 x86,直到发生中断。除非所有中断都被禁用,否则处理器只会停止一毫秒左右。
要关闭现代计算机,请使用 ACPI (Advanced Configuration and Power Interface) .
关于assembly - 如何关闭机器?我正在构建自己的微型操作系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8867363/