Page 1 of 2

Turn off computer

Posted: Tue Dec 29, 2009 3:38 pm
by bongomeno
Does anybody have any assembly code that can be used to shut down the computer?

I am creating a mouse driven GUI called DREAM16 OS (which I will post about later) that needs this for its turn off computer option.

I will compile the code and load it from a DATA statement.

thanks.

Posted: Tue Dec 29, 2009 4:26 pm
by bongomeno
Also, is there a way that I can read how much memory my computer has left and how much it has total? I want to create like a meter or status bar

Posted: Tue Dec 29, 2009 7:17 pm
by burger2227

Code: Select all

SUB Memory
'----------------------------------
'Get memory size (extended mem, kB)
'----------------------------------
OUT &H70, &H15
b% = INP(&H71)
OUT &H70, &H16
b1% = INP(&H71)
BaseMem = CVI(CHR$(b%) + CHR$(b1%))
OUT &H70, &H17
b% = INP(&H71)
OUT &H70, &H18
b1% = INP(&H71)
ExtMem = CVI(CHR$(b%) + CHR$(b1%))
TotalMem = BaseMem + ExtMem
PRINT "Base Memory:"; BaseMem; "K + Extended:"; ExtMem; "K  TOTAL ="; TotalMem; "K"

END SUB

Posted: Tue Dec 29, 2009 7:22 pm
by bongomeno
perfect! thanks. Now I just need to figure out how to turn off the computer... lol :lol:

Posted: Tue Dec 29, 2009 7:38 pm
by burger2227
There are several ways, but doing that could corrupt open files. Files opened need to be saved or closed first. Including Windows stuff. I have a debug routine on my 98 machine if you STAY in DOS only.

You need to determine the OS version to shutdown Windows.

Posted: Tue Dec 29, 2009 7:58 pm
by bongomeno
My GUI is meant to run on a DOS machine or a 95 in DOS mode. This code will be placed at the part of the gui that saves its user made settings and shuts down. As long as it works in true DOS, it is perfect.

I will create a break key or something that shuts down the GUI for people trying it in Windows.

Posted: Tue Dec 29, 2009 10:19 pm
by burger2227
Then your "OS" is doomed because FEW people use DOS alone. Including myself.

Posted: Tue Dec 29, 2009 10:49 pm
by bongomeno
Wel, I am creating this mainly for practice as well as for personal use. Also I am including a special exit option for Windows users that does not shut down the computer, but simply exits.

It is coming along quite well (for my 1st OS). I just got done adding new features, like the ability to drag icons on the desktop with the mouse or save the desktop as well as making it customizable.

Posted: Wed Dec 30, 2009 8:49 am
by Nodtveidt
MS-DOS 7.10 comes with a utility called SHUTDOWN.EXE. I don't think there's source available for it though. You might want to check Ralf Brown's interrupt list; I'm sure there's something there that could be of use to you.

WHOOPS

Posted: Wed Dec 30, 2009 11:03 pm
by OPRESION
Nodtveidt wrote:MS-DOS 7.10 comes with a utility called SHUTDOWN.EXE.
WHOOPS, I USE THE MS-DOS 7.1 = WINDOWS 98SE BUT I COULDN'T FIND IT;
INSTEAD I FOUND IT IN A MORE ADVANCED WINDOWS VERSIONS:
Microsoft DOS shutdown command

IN MY WIN98SE I USE:

SHELL "START/MAX C:\WINDOWS\RUNDLL32.EXE USER.EXE,EXITWINDOWS"

Posted: Thu Dec 31, 2009 1:32 am
by burger2227
IS YOUR CAP LOCK KEY STUCK? QUIT YELLING AT PEOPLE GENIUS!

Posted: Thu Dec 31, 2009 2:32 am
by bongomeno
i lolled. :D
Thanks for the post anyways! I will use this if it works with true dos, otherwise I will have to write my own routine.

Posted: Sun Jan 03, 2010 12:09 am
by OPRESION
burger2227 wrote:IS YOUR CAP LOCK KEY STUCK?
NO, BUT I LIKE UPPERCASING FOR EVERYTHING.
burger2227 wrote:QUIT YELLING AT PEOPLE GENIUS!
I DO NOT LISTEN ANY NOISE IN MY SORROUNDINGS.
SEE THIS PAGE OF MY WEBSITE?
http://basic.phatcode.net/tut/bco.htm
IN THE FUTURE MY WHOLE SITE WILL BE SEEN THAT WAY,
BUT I HAVE NOT HAD TIME TO DO IT (SORRY!)

Posted: Sun Jan 03, 2010 12:24 am
by bongomeno
ummm.... Im sorry, but your site is HARD TO READ! I have seen it before and gave up on it really fast.

My advice would be to change the colors to something more eye friendly.

The background and text should always be light on dark or dark on light.

Posted: Sun Jan 03, 2010 12:55 pm
by burger2227
The fellow is pretty good, but he does not seem to grasp that people cannot read his site pages.

Then he comes here and YELLS at everybody where we can see it VERY well?

LOL :shock:

Posted: Sat Jan 09, 2010 9:50 pm
by OPRESION
bongomeno wrote:My advice would be to change the colors to something more eye friendly.
I AGREE WITH THAT, BUT I'M THOSE KIND OF NERDS WHO CAN LISTEN EVILS
AND THEY MENACE ME IF I USE ANOTHER COLORS. SOME DAY I'LL CHANGE
THEM FOR THE 'MATRIX' COLORS THAT I LIKE THEM SINCE THE MS-DOS WAS
THE KING OF THE HILL WITH THE GREEN PHOSPHORUS MONITORS.

Posted: Sun Jan 10, 2010 12:35 am
by BigBadKing
if you are going to make a matrix-colored site, with everything uppercase.
nobody will bother to visit your site... put up a Unique-Visitor hit counter
on your site, check your hit counter afew days after and see how many
persons visited your site.

Posted: Sun Jan 10, 2010 1:01 am
by BigBadKing
code to shutdown windows:

[code]
SHELL "START C:\Windows\RUNDLL.EXE user.exe,exitwindows exec"
SHELL "exit"
[/code]

remove the space between 'exitwindows' and 'exec' then run the code.

Posted: Sun Jan 10, 2010 2:16 am
by OPRESION
BigBadKing wrote:if you are going to make a matrix-colored site, with everything uppercase. nobody will bother to visit your site.
I THINK IT WOULD BE EASIER TO BE READ. I HAVE COUNTED THE VISITORS SINCE I DID
CREATE THE PAGE AND I HAVE AN AVERAGE OF 300 NOT UNIQUE VISITORS BY DAY.
BigBadKing wrote:... put up a Unique-Visitor hit counter on your site,...
I DID TRY IT USING AN INNER COUNTER OF THE SERVER BUT IT GIVES ME AN
ERROR THAT I COULDN'T SOLVE (IT NEEDS A FILE THAT IT IS NOT CREATED).

Posted: Sun Jan 10, 2010 4:01 am
by BigBadKing
*sign* a NON-UNIQUE hit counter, counts every page visit. i tried to
use it on my site but replaced it with an UNIQUE one. when i had a NON
UNIQUE counter, everything i visited one my own pages. it was added
by one. so a non-unique counter counts every-yours and your-visitor's
visit to every page...