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-08-01 02:20
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Source code of a soft shutdown program under DOS View 5,761 Replies 25
Original Poster Posted 2002-11-28 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
There are quite a few soft shutdown programs under DOS. The ones I know include SHUTDOWN, POWEROFF, OFF, PLOP, etc. Here is the source code of PLOP:
http://plop.at/files/SHUTDOWN.ASM
Wengier - 新DOS时代

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

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

Floor 2 Posted 2002-11-28 00:00 ·  中国 上海 静安区 电信
初级用户
Credits 126
Posts 6
Joined 2002-11-20 00:00
23-year member
UID 291
Gender Male
Status Offline
Is it so troublesome?
.model tiny
.286
.code
org 100h
mov ax, 5301h ;APM v1.1 or v1.2 BIOS switches to APM v1.0
mov bx,0 ;compatibility mode
int 15h ;

mov ax, 5307h ;TURN OFF SYSTEM
mov bx, 1
mov cx, 3
int 15h

;mov ax,4c00h
;int 21h

end
Floor 3 Posted 2002-11-29 00:00 ·  中国 广东 东莞 电信
中级用户
★★
Credits 493
Posts 161
Joined 2002-10-29 00:00
23-year member
UID 94
Gender Male
From ZHCN
Status Offline
At that time, I only knew that WIN could automatically shut down. Later, I analyzed a TEST program of a network card, and there was a program called APM.COM, which was similar to the one on the second floor. It could also soft - shut down the monitor, and I could see that the POWER LED of the monitor was flashing.

[ Last edited by LiveOnLove on 2016-7-14 at 13:02 ]
Floor 4 Posted 2002-11-30 00:00 ·  中国 广东 广州 联通
初级用户
Credits 229
Posts 37
Joined 2002-11-09 00:00
23-year member
UID 207
Gender Male
Status Offline
Oh! With these source codes, what software can be used to compile them into EXE?
Floor 5 Posted 2002-11-30 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
The simplest way is to use DEBUG to compile into an EXE file, or formally use MASM and other compilers.
Wengier - 新DOS时代

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

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

Floor 6 Posted 2002-12-01 00:00 ·  中国 广东 东莞 电信
中级用户
★★
Credits 493
Posts 161
Joined 2002-10-29 00:00
23-year member
UID 94
Gender Male
From ZHCN
Status Offline
Is it compiled into a COM file using DEBUG?

For example:
C:\windows\>debug
-A('-' is the prompt symbol of DEBUG, A is the assembly command of DEBUG, enter after inputting A)
XXXX:0100 mov ax, 5301(XXXX:0100 is the code segment of memory (random) and the offset automatically given by DEBUG, and the following is omitted)
mov bx,0
int 15
mov ax, 5307
mov bx, 1
mov cx, 3
int 15
mov ax,4c00
int 21
-rcx
25(CX register represents the file length, here input is a bit larger than the actual)
-n POWEROFF.com(name the file)
-w(write the file)
-Q(quit DEBUG)
Ok, run POWEROFF.com to see the effect




Floor 7 Posted 2002-12-10 00:00 ·  中国 浙江 杭州 华数宽带
初级用户
Credits 124
Posts 7
Joined 2002-12-09 00:00
23-year member
UID 448
Gender Male
Status Offline
Hehe, thanks, I can see very clearly!
Floor 8 Posted 2002-12-14 00:00 ·  中国 江西 南昌 电信
初级用户
Credits 119
Posts 11
Joined 2002-12-14 00:00
23-year member
UID 508
Gender Male
Status Offline
Can you tell me about the operations with MASM?
ぁ拒签ぁ!!!!!!!!!!!!!
Floor 9 Posted 2003-04-04 00:00 ·  中国 安徽 合肥 电信
中级用户
Credits 272
Posts 43
Joined 2003-04-04 00:00
23-year member
UID 1392
Gender Male
Status Offline
What do these mean?
Floor 10 Posted 2003-04-04 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
The front is calling the INT15 interrupt to perform the shutdown operation, and the back is exiting.
Wengier - 新DOS时代

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

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

Floor 11 Posted 2003-04-07 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
There are already so many programs for soft shutdown and restart, but there is still no program that can directly restart DOS. The following program:
C>DEBUG↓
-A↓
XXXX:0100 XOR AX,AX↓
XXXX:0102 INT 19↓
XXXX:0104 ↓
-N,CQ.COM↓
-RCX↓
:4↓
-W↓
-Q↓

And the one written by Wengier:

MOV AX,0
INT 19

Both cannot restart DOS smoothly. They all crash when the boot screen just appears. Does anyone have a way?
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 12 Posted 2003-04-08 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Found a software to restart the computer, with functions such as cold boot, warm boot, system boot, etc. The system boot menu can successfully restart DOS.
Open the attachment
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 13 Posted 2003-04-10 00:00 ·  中国 广东 珠海 电信
初级用户
Credits 114
Posts 5
Joined 2003-04-02 00:00
23-year member
UID 1356
Gender Male
Status Offline
In 1997, I just wanted to write a program under DOS to implement the soft shutdown function... At that time, I asked many teachers but none knew how to write it... Now, heh heh.......... Finally knew, but it was 5 years later
Floor 14 Posted 2003-04-10 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
I also have the RE-BOOT software, but the function of system startup (that is, rebooting the OS) doesn't work on both of my two computers. On the third old computer, although it can be used, it is found to be not very stable.
Wengier - 新DOS时代

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

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

Floor 15 Posted 2003-04-10 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
It works here, but the stability is not very good either!
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Forum Jump: