中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 00:28
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » How to shut down under DOS
Printable Version  1,741 / 5
Floor1 duyilin Posted 2003-03-16 00:00
初级用户 Posts 5 Credits 117
Now many operating systems such as Windows, Linux; they can all program to implement shutdown in their own software. Plus, now computers have all implemented the ACPI power specification. I can easily implement Windows shutdown in C++. But I really don't know how to implement it under DOS. I hope DOS experts will generously give advice.

The some DOS shutdown software I know. promaigc
You can also use win /z, and shut down by pressing any key
Floor2 Wengier Posted 2003-03-16 00:00
系统支持 Posts 10,521 Credits 27,736
There are people in this forum who have compiled such programs. For details, please refer to the relevant post.
Floor3 duyilin Posted 2003-03-17 00:00
初级用户 Posts 5 Credits 117
Too hard to find, webmaster, can you give a link?
Floor4 duyilin Posted 2003-03-17 00:00
初级用户 Posts 5 Credits 117
Thanks to the webmaster, I have found the method to shut down the computer. Thanks to the English shutdown document from www.ctyme.com
Floor5 蕪迪 Posted 2003-03-18 00:00
初级用户 Posts 7 Credits 114
.Model tiny
.Code
Org 100h
Start:

mov ax,5300h
xor bx,bx
int 15h ; Check APM install
jnb @@1
jmp ExitSys

@@1:
cmp bx,504Dh ; sign
jz @@2
jmp ExitSys

@@2:
cmp ax,101h ; ver 1.1
jnb @@3
jmp ExitSys

@@3:
push cx
mov Version,ax
mov ax,5400h
xor bx,bx
int 2Fh ; power.exe install check?
xor ax,ax
cmp bx,504Dh
jnz @@4
push ax ; power.exe version
mov ax,5401h
mov bx,100h
int 2Fh ; set management enable
pop ax
jb @@4
inc ax
@@4:
pop cx
push ax
push bx
push cx
mov ax,5301h
xor bx,bx
int 15h ; real-mode interface
mov ax,530Eh
xor bx,bx
mov cx,101h
int 15h ; driver version
mov ax,530Fh
mov bx,1
mov cx,bx
int 15h ; engage power management
mov ax,5308h
mov bx,1
mov cx,bx
int 15h ; enable power mamagement
mov ax,5307h
mov bx,1
mov cx,3
int 15h ; power off
pop cx ; support device

test cl,8 ; BIOS power management disable?
jz @@5
push cx
mov ax,5308h
mov bx,1
xor cx,cx
int 15h ; system stand-by
pop cx

@@5:
test cl,10h ; BIOS power disengaged
jz @@6
mov ax,530Fh
mov bx,1
xor cx,cx
int 15h ; disengage power management

@@6:
mov ax,5304h
xor bx,bx
int 15h ; disconnect interface
pop bx
pop ax
test ax,ax
jz ExitSys
mov ax,5401h
mov bl,bh
mov bh,1
int 2Fh ; set APM firmware power manager enable

ExitSys:

mov ax,4c00h
int 21h

Version DW ?

End Start
Floor6 蕪迪 Posted 2003-03-18 00:00
初级用户 Posts 7 Credits 114
That's all right above. Just add it into your program. As for the relevant software, there are also available on the Internet. You can go find them.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023