Sarote Tabcum <stabcum@worldnet.att.net> schreef in berichtnieuws
kTyZ7.4483$fe1.317499@bgtnsc06-news.ops.worldnet.att.net...

Hello Sarote,

> How can I shutdown the PC from inside the application in MS DOS 6.22?
> Appreciate anyone's input.

If your PC has an ATX motherboard and Power-supply it's well possible.  Some
time ago someone gave us the below source

Regards,
  Rudy Wieser

;
; Turn CPU off...
;
; D. Lindauer, July 11 1997
;
; This program is public domain
;
 .model tiny
 .code
 org 100h
start:
 jmp go
ver dw 0
banner db 'Power Management utility V1.0 (LADSOFT) ',10,13,10,13,'$'
nopm db 'No power management functionality',10,13,'$'
errmsg db 'Power management error',10,13,'$'
wrongver db 'Need APM version 1.1 or better',10,13,'$'
;
; Display routine
;
print:
 mov ah,9
 int 21h
 ret
;
; Entry point
;
go:
 mov dx,offset banner ; Display banner
 call print
 mov ax,5300h  ; See if APM available
 mov bx,0   ; device = BIOS
 int 15h
 mov dx,offset nopm
 jc error
 cmp ax,101h   ; See if version 1.1 or greater
 mov dx,offset wrongver
 jc error
 mov [ver],ax
 mov ax,5301h  ; Do a real mode connection
 mov bx,0   ; device = BIOS
 int 15h
 jnc noconerr
 cmp ah,2   ; Pass if already connected
 mov dx,offset errmsg ; else error
 jnz error
noconerr:
 mov ax,530eh  ; Enable latest version of APM
 mov bx,0   ; device = BIOS
 mov cx,[ver]  ; version
 int 15h
 mov dx,offset errmsg
 jc error
 mov ax,530dh  ; Now engage and enable CPU management
 mov bx,1   ; device = all
 mov cx,1   ; enable
 int 15h
 mov dx,offset errmsg
 jc error
 mov ax,530fh
 mov bx,1   ; device = ALL
 mov cx,1   ; enable
 int 15h
 mov dx,offset errmsg
 jc error
 mov ax,5307h  ; Do the power down
 mov bx,1   ; device = ALL
 mov cx,3   ; mode = OFF
 int 15h   ; shutdown CPU
 mov dx,offset errmsg
error:
 call print
 mov ax,4c01h
 int 21h
 int 3
 end start

