PDA

View Full Version : Simple Program?



JaWiB
05-11-2003, 08:51 PM
Is there a way to make a simple enough program that you could type it in notepad and just save it as a .EXE file? It's pretty interesting to type gibberish in notepad and save it that way...hehe

Brighteyes
05-11-2003, 08:57 PM
>Is there a way to make a simple enough program that you could type it in notepad and just save it as a .EXE file?
Sure, you can save it as an executable, it just won't run. :D

adrianxw
05-12-2003, 01:18 AM
If you had complete knowledge of the executable file format, (it is documented), and could convert your program into hex, then I don't see why you should not be able to enter a program into a binary file in the way you describe, however, you would need to use a hex editor as there would inevitably be "characters" that Notepad would not allow.

I have done this on simple systems, in some cases, there were no files, and you HAD to type in the program, in hex, every time you powered the thing up.

confuted
05-12-2003, 02:43 PM
wow, what kind of a system was that?

Brian
05-12-2003, 04:53 PM
Originally posted by adrianxw

I have done this on simple systems, in some cases, there were no files, and you HAD to type in the program, in hex, every time you powered the thing up.

No, adrian, that was just the prompt telling you to eject the floppy, as it isn't bootable.

:D

Brian
05-12-2003, 05:03 PM
It would be quite easy to write a program like that using the old DOS com format. Still works on Windows these days (well it does on windows 2000). But this is not possible in notepad, as there are special characters involved.

One way to write a program in hexidecimal without using any non-standard tools is to open up debug. go into a command prompt and type debug.

then type in E 100 B4 09 BA 09 01 CD 21 CD 20 48 65 6C 6C 6F 24
and press enter. (make sure you get it right or it won't work).
then type rcx and press enter and type in F (the size of the file, 15 bytes) then type
n cool.com
and press enter
then type
w
press enter
press q
and run cool.com



well...anyway...

adrianxw
05-13-2003, 12:36 AM
>>> wow, what kind of a system was that?

Several.

Gould SEL32/77+ supermini's had a habit of not initialising their memory on reboot, so to avoid problems, it was accepted practice to manually key in a sequence of commands on the front panel, manually set the program counter to the base of these instructions then press "run" to write zeroes into every memory location. (~1980)

The very first microprocessor development systems had no backing store. When you turned them on, everything was in a random state. You pressed Restart to init the processor and set it's program counter to zero. You could then, byte by byte, type in your program and then run it. Later, the dev system was fitted with a PROM slot so you could blow you program on one and switch the chips to load different programs. (~1981)

Many others... including some within the last 2 years.