[modified] Programming in the world's most simplest programming language?
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
Brandon T. H. wrote:
could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, a DOS application program executable, and double-click and boom!Yes, it would explode and do nothing useful. When you type a "0" in Notepad, that is not stored as a binary bit. That is stored as a character. A character will be stored by Notepad as anywhere from 1 to 4 bytes, but let's just assume it will save it as 1 byte. This 1-byte representation of a character is called "ASCII" (or extended ASCII, I forget). A byte is composed of 8 bits. Each bit can either have a value of 0 or 1 (numeric, not character). Those 8 bits, when combined, can form 256 combinations. Each of those combinations is considered a character in ASCII, though each of those combinations is also a binary number, which can also be represented as a decimal number. The character "0" is stored in ASCII as a decimal value of 48, which would be a binary value of 00110000 (see, 8 bits). The character "1" is stored in ASCII as a decimal value of 49, which would be a binary value of 00110001. If you only typed "0" and "1" in the text file, those would be the only bit-sequences you'd have available to you. What you could do is type using all of the ASCII characters, which would translate into their corresponding bytes when saved in the file. Some of those characters aren't available on your keyboard, however, so you'd have to enter some funky key combination to type them. Also, one possible issue is that text files sometimes have couple bytes inserted at the front of the file. This may not apply to ASCII files, but it's something to be aware of. In short, you could use Notepad to create a machine code program. However, you'd have to type characters other than "0" and "1" (which do not directly correspond to their numeric equivalents).
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
You'd probably have to write an editor to do that, but you'd have to use more conventional means to accomplish that part of it, so that kind of makes the whole thing pointless. Look, I have something shiny. Why don't you stare at it for a while...
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
Have a look into programming with assembler, for that is basically machine code but using mnemonics to represent otherwise hard to remember sequences of hexadecimal and binary. There have been times when I have hand assembled code for x86 processors for bootloaders and kernels I work on. I often do the same for PIC microcontrollers, which is by far easier as there's only 35 instructions for most of the PIC chips (it's a RISC architecture).
=====
\ | /
\|/
|
|-----|
| |
|_ |
_) | /
_) __/_
_) ____
| /|
| / |
| |
|-----|
|===
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
Brandon T. H. wrote:
could I open ...
Could you? Probably not. Could I? Certainly not. As the other respondants indicated, such an editor* could probably be created (within limits) so the user could type
DEADBEEF
and the actual values, rather than ASCII values of the characters would be written to disc, but using a high-level language is so much easier. * Is that what a HEX editor is? I've never used one. -
Brandon T. H. wrote:
could I open ...
Could you? Probably not. Could I? Certainly not. As the other respondants indicated, such an editor* could probably be created (within limits) so the user could type
DEADBEEF
and the actual values, rather than ASCII values of the characters would be written to disc, but using a high-level language is so much easier. * Is that what a HEX editor is? I've never used one. -
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
There's basically no point to do that. Just use assembly (for whatever platform you're on), each assembly instruction (aside from macros) correspond to exactly one binary instruction. If you really want to understand what's going on, I recommend two books: Code[^] - this explains the basics of how computers work in general, in a very easy to understand way The Elements of Computing Systems[^] - this book walks you through creating an entire computer from NAND gates - you build the processor, memory (all in a simulator, building it by hand would take a long time), an assembler, a compiler for a C-like high-level language, a basic OS, and some other bits.
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
Brandon, In short, yes. I did it in the '60s testing GE 600 mainframe CPUs coming off the assembly line. They didn't work. The IOC and the memory worked, but not much of the CPU. The basic bootload logic from an card reader had to be fixed first (pretty simple), then you coded simple loops testing various instructions and addressing modes until you had enough working to boot load the basic tape test program. The programming was binary, using a 029 keypunch, multi-punch (to hold the card at one column), key in the row bits then release multi-punch to go the next column, then repeat two more times to code an instruction (36 bit machine, took 3 columns to hold an instruction), then repeat up to 27 more times to fill the card. Sometimes you needed a card bootloader to read the next card to complete the little test. Yes, it can be done and has been done. Dave.
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
1. Yes. Assuming you have some way of writing data to a file, you could write the series of byte values which the processor understands and have it execute that code. In the good old days of floppy disks that's just what viruses would do - write a sequence of bytes to the boot sector of a floppy - when the pc boots with the floppy in it tries to execute the code and, assuming you got the bytes written right, it would run it. 2. When you open something in notepad, Notepad translates byte values into text - so what is in the file as a byte containing '00100000' will display as 'A', '00100001' as 'B' and so on. 3. In the good old days (like pre-unix even!) a machine would have a method of setting individual bytes of memory - sometimes via a switch pad - so you would write sufficient code to build the barest of systems, then build tools to write the machine code from assembler code (assembler is just words that the assembler program takes and converts into a byte value - so LDA might be written in a file and the value '34' written to memory, for example. Once C was around most OS builders would write stuff in C - and hack the C compiler to work on their particular machine. 4. in principal a bineary file can indeed be run with no dependencies. But you can write a binary file that has dependencies - so Word.exe is just a binary file, but has lots of dependencies (on the Windows OS, for example). If you want to display graphics, you will be dependent on talking to the graphics card - which you COULD do directly in your code, but would more likely do via a device driver - so there's another dependency. It depends on the OS whether you can delete the executable once it has started running - usually a lock will be made on the file to prevent that happening - but that's the OS doing it. If you just had a plain vanilla dependency-free executable, you could run it without an OS at all (in principal - you need some way to load it into memory and start executing it!) The BIOS in modern computers is of this sort of ilk - it contains bare minimum code to start up the system, display some stuff to the screen etc. but has no reliance on any external software. 5. Each processor has its own machine code. Modern PCs are generally backward compatible with old processors, but there are plenty of processors that are completely different. For example, on one processor the code to add two numbers may be written as ADD A B in assembler; the ADD statement may be instruction number 235. ON another processor the instruction mnemoni
-
Brandon T. H. wrote:
could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, a DOS application program executable, and double-click and boom!Yes, it would explode and do nothing useful. When you type a "0" in Notepad, that is not stored as a binary bit. That is stored as a character. A character will be stored by Notepad as anywhere from 1 to 4 bytes, but let's just assume it will save it as 1 byte. This 1-byte representation of a character is called "ASCII" (or extended ASCII, I forget). A byte is composed of 8 bits. Each bit can either have a value of 0 or 1 (numeric, not character). Those 8 bits, when combined, can form 256 combinations. Each of those combinations is considered a character in ASCII, though each of those combinations is also a binary number, which can also be represented as a decimal number. The character "0" is stored in ASCII as a decimal value of 48, which would be a binary value of 00110000 (see, 8 bits). The character "1" is stored in ASCII as a decimal value of 49, which would be a binary value of 00110001. If you only typed "0" and "1" in the text file, those would be the only bit-sequences you'd have available to you. What you could do is type using all of the ASCII characters, which would translate into their corresponding bytes when saved in the file. Some of those characters aren't available on your keyboard, however, so you'd have to enter some funky key combination to type them. Also, one possible issue is that text files sometimes have couple bytes inserted at the front of the file. This may not apply to ASCII files, but it's something to be aware of. In short, you could use Notepad to create a machine code program. However, you'd have to type characters other than "0" and "1" (which do not directly correspond to their numeric equivalents).
Using Debug.exe whic Microsoft provide as part of their OS since DOS days would be orders of magnitude easier or rather less painful than trying to generate a binary file in notepad. A more comprehensive hex editor easier still. In practice though if you want to write machine code you would be better downloading MASM, writing assemler and allowing the software to convert that to machine code. Has it ever been done - yes - the earliest programs - including the first OSs were entered by setting hardware switches - software had much less bloat then - I wonder why ;)
-
Yes you got it, binary/machine code... Very silly question to ask, been asked plenty of times online, and have been doing some research about it on Google, but anyways... could I program in binary/machine code? More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is. Some other questions: 1.) If I could not do it in notepad, could I boot up a software from the BIOS of the machine of the computer and write it in another program, without loading the Microsoft Windows operating system itself? 2.) I've had opened a application in Windows 7, Windows Vista and Windows XP on Notepad and it's a bunch of special characters/not ones and zeros, why? 3.) Has there been an operating system made completely and "all made" on binary/machine code? If so, how long did it take? did the programmer/s post anything about how hard it was and other details? 4.) Is binary/machine code a "ready to run from source", unlike Python, meaning it can run without a system or no dependencies? Can I click or double-click on it with an.exe
file extension ( can I run it on a Microsoft Windows NT/non-NT operating system) or no extension at all (I have to boot it) and it will run straight from the file (I can't delete it; if deleted will cause an run time error) or does it copy it to memory and then run it? (meaning I can delete the file, but the file itself has been copied somewhere else and then ran, like in-memory?) 5.) Do I have to compile, if I have multiple sources of binary/machine? or do I have to link them, (like in C/C++ including the headers in order to connect all C/C++ soirce files of all types)?Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
Brandon T. H. wrote:
More specifically, could I open
notepad.exe
on Microsoft Windows operating system and jot down a bunch of 1's and 0's and save it as an.exe
, (a DOS application program executable), and double-click and boom! there it is.In a word, no. You need an editor that can save and restore files composed of bytes that can contain any data, not just valid characters. DEBUG.COM used to be the utility for this purpose on DOS; I used this to build my reboot utility (see earlier message) in 1991. You will need to find out details of Microsoft's EXE format so that you build the file correctly enough that Windows will recognize it, then you will need to start practicing with simple programs. Very quickly, you'll realize why, less than five years after ENIAC was announced to the public, assembly language was invented to convert machine code into more readily recognizable symbols, and in just five more years FORTRAN, the first programming language, was born. Programming in machine code can be done, in was was ALL that was done in the very beginning of computing, but no one expect those with extensive time on their hands or strong tendency to OCD would program anything more complex than my reboot routine in machine code, and only the truly performance-obsessed even bother with assembly language anymore.... Except for compiler developers. Good luck :D
"Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover