G
G
GogaGogin2020-10-05 19:01:29
assembler
GogaGogin, 2020-10-05 19:01:29

Assembler, how is the translation of this code into object code?

5f7b431d92ed0497123113.png
ADD AX,BX -> 01 C3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2020-10-05
@Rsa97

And what about the object code?
You have assembly source code and machine code.
The translation is very simple.
We take the table of opcodes and see that the command ADD r16, r16corresponds to opcodes 01and 03. We take any of them.
The second byte is formed from two bits of the Mod mode, for the register-to-register operation this is 11, and bits with register numbers AX - 000and BX - 011. Writing in full, we get 11000011or C3.

F
freeExec, 2020-10-05
@freeExec

So it is in the documentation for the processor that it is indicated which machine instructions are processed and what they mean. No logic, just a table of correspondences from one to another.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question