0

How did these earlier programmers know what combinations of binary produced certain results? Is there a way I can create an assembler from binary today?

Nanotwerp
  • 27
  • 2
  • see also [How exactly do we go from Binary/Hex to Assembly Instruction sets?](http://programmers.stackexchange.com/questions/110740/how-exactly-do-we-go-from-binary-hex-to-assembly-instruction-sets) and [How were the first compilers made?](http://programmers.stackexchange.com/questions/88428/how-were-the-first-compilers-made) – gnat Feb 15 '15 at 22:30

2 Answers2

4

Every microprocessor has an instruction set. Each instruction corresponds to a specific binary code. You can find out which binary code corresponds to which processor instruction by reading the specification sheet for the microprocessor.

From there, it's simply a matter of specifying the binary codes in the right order to produce the desired result.

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
3

Robert Harvey is correct.

However, you can create an assembly language at the same time you write an assembler. It's a cyclical process, where you add code to the assembler to process your assembly language into operation codes, or opcodes.

Ideally, each assembly language instruction is represented by an opcode. Sometimes, one assembly instruction requires many opcodes.

You also need a linker, to link assembly object modules together into an executable program. Back when assembly was the only language choice, the linker was a separate program, run after your code was assembled.

Gilbert Le Blanc
  • 2,819
  • 19
  • 18
  • 1
    So to create an assembler, I should download the Intel list of opcodes and go from there? – Nanotwerp Feb 15 '15 at 23:39
  • 1
    @user2759612 I wouldn't start from any list Intel produces, as to the best of my knowledge no such list is complete. The best list of opcodes and description of how they are generated to my knowledge is Appendix A of the NASM manual. – Jules Feb 16 '15 at 08:39