Eric S. Emerson wrote:
>
> Hi Clarence,
> Me too !
> Just as it got interesting ! ;-}
>
> On Mon, 23 Jul 2001, Bastiaan Edelman wrote:
>
> > On Sun, 22 Jul 2001 21:23:33 +0200, Bernie <[EMAIL PROTECTED]> wrote:
> >
> > > Clarence wrote:
> > >> Instructions entered at the DOS prompt are interpreted by the operating
> > >> system, not the machine.
> >
> > > Ahem, the shell not the OS.
> >
> > >> 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. :(
> >
> > > Just as it got interesting ;-)
> > > //Bernie
> >
> > Just as it got interesting ;->
> > Bastiaan
With sincerest apologies to those I DO bore, and to Bernie for me sending
this to him twice, and thanks to Andy for his participation in this game,
here is the next chapter in the exchange with Andy.
Please forgive me my occasional misspeak as I've probably been trying to
answer more quickly than necessary.
Bernie is quite correct. It is the SHELL that interprets keyboard entry,
not DOS itself. This is very obvious with Linux, but how many of us DOS
users think of that line in config.sys: SHELL=C:\COMMAND.COM. <G>
<quote>
ANDY wrote:
>
> I was/am under the impression from my DEC PDP-11/73 mini-computer days
> that I could type DOS>exit then be able to type directly to the chip
> binary numbers(ones and zeros like 11010011)/instructions (which were the
> composition of the boot program for RSTS/E or the DEC PDP-11/73 computer
> itself)___ I was/am afraid to do this, i.e. type DOS>exit for fear I might
> never get back into dos again-
Hi Andy;
DOS is fairly smart about this, and won't let you exit from the first loaded
copy of command.com. You can type COMMAND at the DOS prompt and load another
copy of command.com, and you can do this repeatedly, just using up memory.
Typing exit in this case will remove the last loaded command.com. You can
repeat this until only one remains - but it can't be removed by this method.
The DEC computers wouldn't allow you to type ones and zeros either unless
there was some interpreting program running. In order for the DEC to even
UNDERSTAND what a one IS, a service routine must be running to take input
from the teletype or terminal and then another routine must examine the
input and decide what it is.
With all the DEC and Data General minicomputers there was a front panel
switch bank. HERE you could set up a word comprised of ones and zeros and
with the flip of a special switch DEPOSIT that number in memory.
Then, after a series of numbers had been deposited (e.g. the bootloader)
this comprised a tiny program that operated the paper tape reader and
allowed you to load a more complex program that could listen to the teletype.
> (can I assume any file.com
> is a hex or assembly language program?)
Yes.
> (and does it matter whether you
> use .com OR .exe when creating/saving/making a hex (or I guess assembly
> lang. too) program/file
Yes. They are different in internal format. Use .com - it is the simplest.
> in the example you gave me of a hex program there are no binary(ones and
> zeros like 11010011) in the program, I thought there would be...
The example was HEX so there was no binary visible.
HEX is one shorthand way to describe a group of 8 binary bits.
e.g. HEX Binary
00 00000000
01 00000001
02 00000010
03 00000011
04 00000100
08 00001000
09 00001001
0A 00001010
0B 00001011
0C 00001100
FF 11111111
So, when you enter the HEX, the result is still binary.
Regardless of WHAT you enter the result is ALWAYS translated to binary.
> I mean you said that with hex you could do something quick without an
> editor or assembler... is not DEBUG.EXE an editor or assembler? I saw
> there is a DEBUG command: assemble, so I guess it *contains* an assembler
> so I guess further that with DEBUG.EXE one could write/create/save
> assembly language programs as well hex language programs
That is correct. The next step would have been to show you how to enter
the same program in assembly language format using memnonics.
Memnonics are meaningful abbreviations of what the instruction is supposed
to do. But the actual result (the instruction) is still hex format binary.
Re: Do something quick. There is no way with a PC of any vintage to enter
binary instructions directly to memory to form a program. There is no
switchpanel. And the instructions MUST be in memory. I may have misguided
you when I said something like: "present the instuctions to the machine".
Actually, the machine LOOKS for instructions in memory. It looks where you
(or DOS) tells it to look for the FIRST instruction, and then it proceeds
in an orderly manner sequentially through memory until the result of an
instruction tells it to go somewhere else. (Branch)
So, you must somehow get the instructions into memory. There is no way to
do this from the keyboard. I suggested debug as a simple expedient to
make a file that DOS would load into memory for you.
There is a more obscure way to do this without using debug, if you wish
to try it. It uses the re-direction abilities of DOS to write your keyboard
entry directly to a file. Unfortunately, since there is no HEX translator
built into the keyboard, your data entry is going to seem quite strange. <g>
Type copy con: myprog.com <enter>
Type alt178 (use the KEYPAD)
(hold down the alt while entering 178 then lift alt - do not hit enter)
Type alt07 alt180 alt02 alt205 alt33 alt205 alt32
(note that you lift alt between the above entries and still do not hit enter)
Type cntrlZ <enter>
DOS has the builtin ability to create the necessary binary patterns, but
the number system is decimal, not hex. The exact same patterns are created.
What happens above is that the first line instructs DOS to send whatever
you type at the console (keyboard) to a file called myprog.com.
Then these digits are entered:
178 (=Hex B2) (=10110010 Binary)
07 (=Hex 07) (=00000111 Binary)
180 (=Hex B4) (=10110100 Binary)
02 (=Hex 02) (=00000010 Binary)
205 (=Hex CD)
33 (=Hex 21)
205 (=Hex CD)
32 (=Hex 20)
Followed by controlZed which is the end-of-file character (Decimal 26,Hex 1A)
Followed by enter which tells DOS you are done, and it closes the file.
This is the exact same program as before, and no Debug is required.
The important thing to get a handle on is the different number systems.
A number is a number and no matter what name you give to it, it is still
the same number of apples:
eg 10 Decimal, 0A Hexadecimal, 12 Octal and 1010 binary all describe the
exact same number of widgets.
</quote>
- Clarence Verge
--
- Help stamp out FATWARE. As a start visit: http://home.arachne.cz/
- The internet is infected - Windows is a VIRUS !!
--