China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 20:46
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How to shut down under DOS View 1,653 Replies 5
Original Poster Posted 2003-03-16 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 117
Posts 5
Joined 2003-03-16 00:00
23-year member
UID 1151
Gender Male
Status Offline
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
Floor 2 Posted 2003-03-16 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
There are people in this forum who have compiled such programs. For details, please refer to the relevant post.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 3 Posted 2003-03-17 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 117
Posts 5
Joined 2003-03-16 00:00
23-year member
UID 1151
Gender Male
Status Offline
Too hard to find, webmaster, can you give a link?
Floor 4 Posted 2003-03-17 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 117
Posts 5
Joined 2003-03-16 00:00
23-year member
UID 1151
Gender Male
Status Offline
Thanks to the webmaster, I have found the method to shut down the computer. Thanks to the English shutdown document from www.ctyme.com
Floor 5 Posted 2003-03-18 00:00 ·  中国 广东 深圳 龙岗区 电信
初级用户
Credits 114
Posts 7
Joined 2003-03-18 00:00
23-year member
UID 1172
Gender Male
Status Offline
.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
Floor 6 Posted 2003-03-18 00:00 ·  中国 广东 深圳 龙岗区 电信
初级用户
Credits 114
Posts 7
Joined 2003-03-18 00:00
23-year member
UID 1172
Gender Male
Status Offline
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.
Forum Jump: