Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Look, I know this is discouraged and could be basically viewed as useless, but I just want to try to put myself in the earlier programmers' shoes a bit. Is there a way I can run pure binary?

share|improve this question

put on hold as too broad by Robert Harvey, gnat, GlenH7, MichaelT, Yannis Rizos 2 hours ago

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit your question.

6  
There are tons of hex editors out there, but I don't know of any binary editors. Of course, if you're really interested in hardcore old school programming, you could always get a keypunch and some punch cards. =) –  Ixrec 13 hours ago
    
I did some practices in PDP-11 emulators. While not strictly binary but assemblers, conversion from assembler to binary is direct (v.g., instruction add is 0001 or whatever), the instruction set is nice (that's why it was used for teaching), and you see the (binary) memory with program and data and how does it change. –  SJuan76 6 hours ago
1  
The correct name for what you called binary is "machine code", which is specified in the architecture document of the CPU. –  rwong 5 hours ago

4 Answers 4

Get an Altair 8800 from Craigslist or Ebay. It is programmed in binary using front panel toggle switches.

Alternatively, you can try an emulator or buy a clone.

share|improve this answer

Minecraft. (video in link)

Is there really a single as simple, easy to acquire and fun way of coding in binary? Sure, you may not be inputting zeroes and ones as zeroes and ones, but it's pretty damn close to working directly with logic gates.

I can tell you, rarely have I felt the accomplishment of the same magnitude as when I finally managed to make a simple calculator that succesfully added two positive integers together.

There are some tricks you may have to learn, if you're not already accustomed to minecraft, but I think the same goes with every technology. Stupidly enough, minecraft being a pretty popular game, it comes with megatons of tutorials to get you started, and beyond.

share|improve this answer
1  
Try building a 16-bit ALU in Minecraft and see why it's discouraged. It's worth the sight :-) –  Mast 8 hours ago
1  
@Mast: Give me names of the people discouraging others from building sweet Minecraft ALUs and I will find them and bring them to justice. –  Marcks Thomas 7 hours ago

If you want to program a modern PC with binary without getting additional hardware, you can do the following:

  • Learn assembly to get the basics.
  • Edit your code with a Hex / binary editor.
share|improve this answer

To give you some context from someone who actually programmed with lights and switches:

Even then I would program in assembly and then use the output of an assembler to enter the "binary" data into the computer. (My output was octal or hex, but they map one-to-one with binary).

for example: one machine instruction might be to load from a memory location into a register. so I would write
ADD r1,1234

the output of the assembler might be something like: 000000 033445 ADD r1,1234 000001 001234

where the columns are: address, data/instruction, original assembly.

in this case, the first address (0) would be filled with 0011011100100101 which is octal 033445 in binary. then next address (1) would be filled with 0000001010110100 the location to read the data from (octal 1234).

I hope that gives you a basic idea. There where complications/simplifications of course. we would typically brake up a program into files that could be independently assembled (with relative rather than absolute address) and then link them together, and then load them into memory with a loader, (but during a debug session, hand assembling one-or-two instructions or replacing an instruction with HALT

And of course a lot of the things required in assembly programming that higher order languages handle automagically would still need to be handled manually. e.g. 1. calling a function with parameters (including saving/restoring registers) 2. any data typing (is it a character, string, int/long, signed/unsigned, etc). 3. handling return values. 4. interupt handlers 5. etc.

As mentioned in several responses above, a strong understanding of assembly would be required before actually performing binary programming (whether or not you actually did the bit-conversions yourself).

for an actual example of a relatively simple machine instruction set see: http://users.rcn.com/crfriend/museum/doco/DG/Nova/base-instr.html

GT

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.