On Sat, 21 Jul 2001 20:30:32 -0400 (EDT), ANDY <[EMAIL PROTECTED]> wrote:
> I am at the DOS> prompt, how or *where*? would I type in the hex
> instructions??
> I am assuming that the last hex instruction in a hex program would
> run/execute it
Thank you for the reply Andy. It is either a very good joke, or proof
that I'm not wasting my time. <G>
It is not the last instruction in the program that makes it run, it
is the manner in which the hex code is presented to the machine.
The last instruction actually is more likely to end the program and
return the operation of the machine to the OS prompt.
Instructions entered at the DOS prompt are interpreted by the operating
system, not the machine. DOS doesn't recognize hex instructions unless
you happen to name a file AEAE.bat or F0F0.com or 123C.exe and then it
is only interested in the extension, not the accidental hex filename.
It might be best not to try the last two. <g>
The operating system recognizes only valid OS commands and existing
filenames. Any other entry will result in an OS error message.
The extensions of the filenames are examined (in DOS - not *ix) to
see if they are executables. A .bat is a series of DOS text comands
which are interpreted one after the other as if they were entered at
the keyboard. The extension .com and .exe specify that the files are
to be treated as if they contain executeable binary code, and this
code is presented to the machine by DOS.
If you want to try a simple experiment in Hex programming, you will
need some way to convince DOS to pass your code to the machine, and
the easiest way to do this is to create a file with a .com extension.
To be useful, this file should contain real hex instructions and not
text or garbage, because the machine WILL try to execute it. :(
I won't try to give a tutorial on hex programming here, so some of
what I write here will seem a bit arbitrary - just trust me until
you know what is safe to try. ;-)
You can use a program called debug to accept hex entry and create the
required file. I'll assume you have debug.exe somewhere in your path.
I'm showing only your entry here - you can ignore any messages:
Type DEBUG myprog.com <enter>
Type E100 B2 07 B4 02 CD 21 CD 20 <enter>
Type RCX <enter>
Type 08 <enter>
Type W <enter>
Type Q <enter>
You have just entered the hex code the machine will interpret as
instructions to tell DOS to beep, and saved it in a file called
myprog.com.
Now, if you type MYPROG <enter> at the DOS prompt, you will get
a beep. <G> If you rename myprog.com to myprog.sav, DOS won't
beep anymore when you try it.
For a detailed explanation of what you did with debug, write to me
personally as I'm afraid I'm boring some of the listmembers now. :(
- Clarence Verge
- Back to using Arachne V1.62 ....