How were computers “commanded” before computer languages existed?

2.40K views

How were computers “commanded” before computer languages existed?

In: Technology

5 Answers

Anonymous 0 Comments

A computer processor, at it’s most basic level, has a bunch of hard-wired commands built into it called an “Instruction Set”. These are basic things like “Load data from here” “Add these values together” “Move data to here”, a big list of operations that, together allow the processor to perform any task you can throw at it.

* Machine code

These functions can be harnessed by directly talking to the processor in a language it understands, and the bottom rung of this communication is something called Machine Code. Literally ones and zeroes. Binary.

The documentation for a particular processor will include a table of information saying what binary input will equal a particular instruction set instruction.

So you can in theory program a processor right down at the bottom rung level, using direct machine code input.

The first home PCs were programmed this way, like the [Altair 8800](https://upload.wikimedia.org/wikipedia/commons/3/35/Altair_8800%2C_Smithsonian_Museum.jpg) or the [IMSAI 8080](https://kyozoufs.blob.core.windows.net/filestoragedb1/Pictures/_17/16780/16779875.jpg) using those switches at the front.

As you can imagine though, programming a computer instruction by processor instruction (which might need several separate instructions to simply add two values together) is a long, long process, very prone to errors. Get a single zero where you should’ve had a one, and that’s it. So they improved things a little.

* Assembly Language

This was the next step up. Rather than having to look up what binary code equals a particular instruction and actually writing the code in binary, an assembler allows you to write those instructions directly, giving a much more human-readable result to your code. Rather than a string of binary code, an assembly instruction might now look like this:

MOV RB, 61h

That means basically “load location ‘RB’ with the value 61H” Still doesn’t make a lot of sense if you don’t know what any of those instructions do, but it’s far more digestible than a list ones and zeroes, which you’d have to go back to a lookup table to work out what they even mean.

A random trivioid here is that Rollercoaster Tycoon was written entirely in assembly language in order to maximize performance. If you’re writing directly in the processor’s instructions, which you are doing in assembly language, you can make every last instruction count, and make the whole thing as efficient as possible. This is why Rollercoaster Tycoon always ran very well even on pretty low end hardware back in the day, while still looking very impressive.

You’d type Assembly Language into a program called an Assembler, which would then output (or assemble) the machine code ones and zeroes for you.

So that’s assembly language. More digestible than direct machine code, but still pretty hardcore, because turning instructions like “move data to here”, “load this area with data”, “add these values together” into something like, I don’t know, a copy of Windows, or The Witcher 3, seems almost impossible. It is how all computers work though at the bottom level, all processors no matter how fancy the programming interface you use is, use machine code at the hardware level.

Next level up.

* High-Level Languages

These are basically modern programming languages like Visual Basic, C, Pascal, Python, and so on.

The whole point behind a high level programming language is to take the rather abstract and alien processor instructions, and lay over it a nice (relatively) easy to understand language that behaves as a human operator might expect.

But the difference is, now the higher level programming language instructions (or ‘commands’) don’t necessarily have to match up with the instruction set the processor uses. That’s not their point. The point of them is to make a more intuitive framework that you can use get the task you want the computer to do down in a way that you understand, and then the language ‘compiles’ that code you’ve written into a big tottering pile of machine code that the processor can understand. The language can consist of any number of commands, and functions that make writing a program more easy, and some languages will have commands that more suit it to particular tasks (which is kind of why multiple higher level programming languages exist in the first place, to cater to different use cases).

* Visual languages

Arguably a level above even higher level languages that would be visual languages. These are things like [Labview](http://forums.ni.com/legacyfs/online/202594_Hololens_LabVIEW_simple_example.png), or the language included with the Lego Mindstorms kits, [Robolab](http://web.ncf.ca/aa333/bumper.gif).

These go a step further by giving you a visual interface, with boxes you can drag around and lines you can drag between stuff to give an even more human-friendly method of telling the computer what you want it to do.

The further these languages go from machine code, the less efficient they might be, but the more intuitive and understandable to the average human they ought to be too, so it’s swings and roundabouts.

All these languages do is output machine code though because even now that’s how the processor does its thinking. The languages just do it, so you don’t have to.

You are viewing 1 out of 5 answers, click here to view all answers.