Compile, register, memory, mov instruction

A relationship between the code and the compilation and binary

 

 

  II. Review the composition principle of computer knowledge

1. Register

There are three computer storage

 

 

 Cpu 32-bit register provides three types of 8 16 32

 

 

 

 64 only the extensions 32 and 32 procedures are mostly

 The following are eight 32-bit general purpose registers (having a width)

 

 

2.MOV instruction

 

mov eax, 1 (the eax register to save 1)

 

mov edx, eax (edx inside the EAX value stored to )

 

 

 

Examples: EAX: 32-bit general registers if a FFFFFFFF F (16 hex) into a binary 1111, i.e. 4

           So why is it called 32 (four bytes)? 4 * 8 = 32

 

 

 

III. Memory

1. Memory

        Memory and physical memory is not memory! Between physical memory and a layer of memory mapping relationship.

   The following words are not really to each sub-process of the memory 4g, and other process really going to write / read memory when put 4g memory mapped to physical memory up.

   

 

 

 

2. Memory Address

Not too much memory a name can only use numbers.

Memory number represents one byte each row

 

 

 

 

 

3.mov command to write data to memory

And to register which is written is not the same memory eax32 bit ax16-bit data width comes he is,

The memory is not the same, the memory is put together in a large

and so!

Differences: write to memory when you must explicitly tell its width.

byte = 1 byte

word = 2 bytes

dword = 4 bytes

 

 

 

 

 

<1>

 

 

 

 Then there is a problem that the line is a byte memory address number.

Now the village is four bytes of data, then it feasible?

Feasible, it will then write back from the memory number you specify.

 

<2>

  

 

  May not be written mov dword ptr ds: [18FFFC], ax not the same as the width 

<3>

  

 

 

 

  Remember that most of the assembler instruction which is not from memory to memory. You have to go through the register.

  

IV. Five forms of memory address

 

 

 

 

 

 

 

 

 

 

 That is the second form is the first memory into the register in the go

 

 

 

 

 

       Writing to a first register address and register +4 immediate data written to the memory address (register +4) go after

   

 

 

  第四种形式主要就是高级语言生成的数组,汇编之后就是这样的形式

 

Guess you like

Origin www.cnblogs.com/cat47/p/12243785.html