Shutting down computer with nasm

前端 未结 3 2023
无人共我
无人共我 2021-01-29 05:16

Is it possible to shut down or kill the power (is there a difference?) to a computer from nasm. I know you can use this to reboot:

mov al, 0xFE
out 0x64, al
         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 05:50

    you can try this code:-

    shutdown_sucess:
      mov ax, 5301h             ; Connect to the APM
      xor bx, bx
      int 15h
      je near continue_connection       ; Pass if connected
      cmp ah, 2
      je near continue_connection       ; Pass if already connected
      ret               ; Bail if fail
    
    continue_connection:
      mov ax, 530Eh             ; Check APM Version
      xor bx, bx
      mov cx, 0102h             ; v1.2 Required
      int 15h
      ret       
    

提交回复
热议问题