What is the difference between assembly and binary?

I have problems understanding the difference between assembly and binary. I just need to understand what is the relationship between related binary and assemblies.

+4
source share
4 answers

The assembly is basically binary code written in a form that people can read. Then the assembler takes the assembly code and translates it line by line into the corresponding bit code.

Imagine that there is a table with a line for each possible assembly statement. Then on each line on the left is the instruction itself, and on the right are the corresponding bits that the computer can understand

, , .., , .

+7

- . , Base2 Zero One's. 0 1. . .

, . . , HEX- 8B 0E 34 12, 8B move 0E - (, ). , Hex- , "10001011000011100011010000010010", , Binary

Assembly - , , ​​ . , 8B 0E 34 12 MOV CX, 1234H.

, .

+5

wiki . .

. asm , . NAS8 x86 db 0x30 .

. add eax, [rdi + rdx*4] Intel- x86 , . ( ) .

, , (, .text .data), , . , , , .

, . godbolt. asm.

+3

Binary , char. , "2", , , , , - id 2, no.2, caculate , char....

, , , .

, , :

1. 1

2.add 1

3.

insctrction, .... ? , , - conbination of 0 1 to , . , 0001 , 0010 , 0011 , - :

0001 000000001

0010 000000001

0011 000000101(000000101 is a location where you store the stuffs in 

)

, , :

0001 -> load

0010 -> add

0011 -> store

...

load  1

add   1

store 5

! (, ~)

you can see when you translate it, 0001 is not really a number, 00000001 is. therefore, 0001 is just a designation, and the assembly is used to replace a cahr type note for better reading. 00000001 is really a number, and you can write it in any other form, but the match for the decimal is 1, since hex is also 1 :)

0
source

Source: https://habr.com/ru/post/1627676/


All Articles