PDA

You are currently viewing a search engine-friendly (archive) version of this page.

View Full Version : Crash That Machine! Yeah!


MikeFoster
March 31, 2001, 05:25 am
When you start learning the C language you start to realize that you have ultimate control over that machine. C doesn't try to isolate you from the hardware - in fact it encourages you to explore the hardware!

One of first things that really blew me away was being able to write directly to the video buffer in RAM. Its really fast! But even tho it doesn't take much C code to do it, there are several important hardware concepts that you'll have to grapple with... before you can run your program without making your PC crash and burn! LOL!

So here you go... Crash that machine and enjoy doing it!


/* Output a string at specified X,Y coordinates.*/
void xyputs(int x, int y, char *str)
{
while(*str) outchar(x++, y, *str++);
}

/* Output a character at specified X,Y coordinates.*/
void outchar(int x, int y, char ch)
{
char far *v = (char far *) MK_FP(0xB800, 0000);

v += (y*160) + x*2; /* compute char loc */
*v++ = ch; /* write the character */
*v = 7; /* default attribute */
}



------------------
Try these HelpFromTechs.com Web Development Resources:
Reference Links (http://www.helpfromtechs.com/ubb/Forum8/HTML/000054.html)*|*User Authentication (http://www.helpfromtechs.com/ubb/Forum8/HTML/000071.html)*|*HTML Editors (http://www.helpfromtechs.com/ubb/Forum8/HTML/000030.html)*|*Perl/CGI (http://www.helpfromtechs.com/ubb/Forum8/HTML/000016.html)*|*Embedding Music (http://www.helpfromtechs.com/ubb/Forum8/HTML/000067.html)

reddsteel
March 31, 2001, 10:12 am
That is pretty cool Mike!

------------------
Jordan Gadd (reddsteel)
HelpFromTechs.com Moderator
reddsteel@helpfromtechs.com

MikeFoster
March 31, 2001, 02:38 pm
Thanks reddsteel,

I just want people to realize that crashing their PC can be fun! I know, I do it all the time! http://www.helpfromtechs.com/ubb/smilies/lol.gif

And if they can't get it running again, just come to HelpFromTechs! http://www.helpfromtechs.com/ubb/smilies/wink.gif

Have a good un!

------------------
Try these HelpFromTechs.com Web Development Resources:
Reference Links (http://www.helpfromtechs.com/ubb/Forum8/HTML/000054.html)*|*User Authentication (http://www.helpfromtechs.com/ubb/Forum8/HTML/000071.html)*|*HTML Editors (http://www.helpfromtechs.com/ubb/Forum8/HTML/000030.html)*|*Perl/CGI (http://www.helpfromtechs.com/ubb/Forum8/HTML/000016.html)*|*Embedding Music (http://www.helpfromtechs.com/ubb/Forum8/HTML/000067.html)

reddsteel
March 31, 2001, 05:29 pm
http://www.helpfromtechs.com/ubb/smilies/lol.gif Sounds like a plan! http://www.helpfromtechs.com/ubb/smilies/grin.gif

------------------
Jordan Gadd (reddsteel)
HelpFromTechs.com Moderator
reddsteel@helpfromtechs.com

Tonker
April 2, 2001, 11:23 am
Crashing the machine, eh? I'll have to try that code at some point. It'd be so nice to do it on purpose for a change. http://www.helpfromtechs.com/ubb/smilies/wink.gif

------------------

MikeFoster
April 3, 2001, 06:59 pm
You're right Tonker! http://www.helpfromtechs.com/ubb/smilies/grin.gif

------------------
Try these HelpFromTechs.com Web Development Resources:
Reference Links (http://www.helpfromtechs.com/ubb/Forum8/HTML/000054.html)*|*User Authentication (http://www.helpfromtechs.com/ubb/Forum8/HTML/000071.html)*|*HTML Editors (http://www.helpfromtechs.com/ubb/Forum8/HTML/000030.html)*|*Perl/CGI (http://www.helpfromtechs.com/ubb/Forum8/HTML/000016.html)*|*Embedding Music (http://www.helpfromtechs.com/ubb/Forum8/HTML/000067.html)

Zerio
April 18, 2001, 07:51 pm
Originally posted by MikeFoster:

Thanks reddsteel,

I just want people to realize that crashing their PC can be fun! I know, I do it all the time! http://www.helpfromtechs.com/ubb/smilies/lol.gif

And if they can't get it running again, just come to HelpFromTechs! http://www.helpfromtechs.com/ubb/smilies/wink.gif

Have a good un!



If they couldn't get their machine running, they couldn't necessarily come to here.
And I do agree, C++ rules



------------------
Zerio
http://pub45.ezboard.com/bzerio

MikeFoster
April 22, 2001, 02:50 am
LOL! Good Point! http://www.helpfromtechs.com/ubb/smilies/lol.gif

------------------
Try these HelpFromTechs.com Web Development Resources:
Reference Links (http://www.helpfromtechs.com/ubb/Forum8/HTML/000054.html)*|*User Authentication (http://www.helpfromtechs.com/ubb/Forum8/HTML/000071.html)*|*HTML Editors (http://www.helpfromtechs.com/ubb/Forum8/HTML/000030.html)*|*Perl/CGI (http://www.helpfromtechs.com/ubb/Forum8/HTML/000016.html)*|*Embedding Music (http://www.helpfromtechs.com/ubb/Forum8/HTML/000067.html)