Shutdown the computer using assembly

后端 未结 10 668
日久生厌
日久生厌 2020-12-08 11:27

How can I shutdown the computer using only assembly code?

10条回答
  •  庸人自扰
    2020-12-08 11:38

    This is the 29 byte program that I have been using to turn the computer off in DOS mode for years.

    ;Connect to APM API
    MOV     AX,5301
    XOR     BX,BX
    INT     15
    
    ;Try to set APM version (to 1.2)
    MOV     AX,530E
    XOR     BX,BX
    MOV     CX,0102
    INT     15
    
    ;Turn off the system
    MOV     AX,5307
    MOV     BX,0001
    MOV     CX,0003
    INT     15
    
    ;Exit (for good measure and in case of failure)
    RET
    

    You can lookup more functions with Ralf Brown’s Interrupt List at DJGPP.

提交回复
热议问题