Thread: Simple Program?

  1. #1
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972

    Simple Program?

    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
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  2. #2
    Open to suggestions Brighteyes's Avatar
    Join Date
    Mar 2003
    Posts
    204
    >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.
    p.s. What the alphabet would look like without q and r.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    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.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    wow, what kind of a system was that?
    Away.

  5. #5
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    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.


  6. #6
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    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...

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> 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.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with a very simple program
    By htdefiant in forum C++ Programming
    Replies: 13
    Last Post: 08-14-2007, 01:27 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. [Help] Simple Array/Pointer Program
    By sandwater in forum C Programming
    Replies: 3
    Last Post: 03-30-2007, 02:42 PM
  4. simple silly program
    By verbity in forum C Programming
    Replies: 5
    Last Post: 12-19-2006, 06:06 PM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM