-1

This question already has an answer here:

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?

marked as duplicate by gnat, davidk01, GlenH7, yannis Feb 16 '15 at 4:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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.

  • 1
    So are these what are called opcodes? – Nanotwerp Feb 15 '15 at 21:08
  • Yes, opcodes... – Robert Harvey Feb 15 '15 at 21:44
2

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.

  • So to create an assembler, I should download the Intel list of opcodes and go from there? – Nanotwerp Feb 15 '15 at 23:39
  • @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 8:39

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