Hello everybody! It is known that the assembler does not allow copying data from RAM into it (L1, L2 - labels):

mov [L1], [L2] ; ошибка 

Question: Then why is the next command allowed?

 not byte [L1] 

To do this, at the same time you need to read from memory and write to it. And RAM allows you to perform only one operation at a time. So intermediate results are stored somewhere? General registers after this instruction has not changed.

  • > General registers after this instruction has not changed. There are more real registers in the processor than you see in the debugger. - nitrocaster
  • Both teams work according to the same scheme. Reading from memory to the register -> performing actions -> writing back to memory. What is the first team in this plan more difficult? - goodcode
  • @asv, when performing a single machine operation, several micro-operations can be performed, there is physically no prohibition on "simultaneous" (in fact, sequential) access to memory. In fact, only operations that use 2 explicitly specified operands in memory (such operations are simply absent in the command system of x86 processors) are prohibited. Why explicitly given ones - read about the movs, cmps and their ilk operations, they refer to two operands in memory, whose addresses are implicitly specified through the esi and edi registers. - insolor
  • Andrew, in general, allows the essence of the function of direct copying from the memory cell by the pointer [esi] to the cell by the pointer [edi] with the post-increment of both pointers. - Mal Skrylev

3 answers 3

(I will turn my ancient comment in response)

When performing a single machine operation, several micro-operations can be performed, physically there is no ban on "simultaneous" (in fact, sequential) memory access. In fact, only operations that use 2 explicitly specified operands in memory (such operations are simply absent in the command system of x86 processors) are prohibited. Why - because Intel engineers designed it this way.

There are movs , cmps and other operations that refer to two addresses in memory “simultaneously”, which are implicitly specified via the esi and edi .

    In fact, the x86 processor architecture allows you to copy data directly from memory (RAM) to memory, bypassing downloads, into general-purpose registers. The essence of the function of direct copying from the memory cell by the pointer [esi] to the cell by the pointer [edi] with the postpoint of both pointers.

    As for the operation of denial, it, as usual, is performed on the inverter. The general scheme is as follows:

    1. Data loading from memory in ALU (in modern processors it is almost indistinguishable from the processor itself%).

    2. Perform a negation operation.

    3. Save the result to memory at the same address.

      The short answer is because when a command is translated into a binary form , then there is no room for two addresses in memory. Therefore, the mov command cannot work with two cells in memory, but not - is able. For the same reason, mov cannot work with the IP register (the address of the command in memory).