assembly - x86 assembler question -


I have 2 simple, but perhaps difficult questions, assume I have assembler instructions: MOV EAX, [ebx + 6 * 7] - Am I curious, is this instruction actually actually converted into opcode because it is standing, so the code count in the brackets is encoded in the open, or this is just a pseudo-instruction for the compiler, not the CPU , So that in the bracket using the Compiler Elg MUL Knowledge of counts, then stores the result in some reggae and uses reggae with Movi Iaadi, compute value? Just to be clear, I know that the output will be the same. I am interested in execution.

Second, I am about the direction of the LEA, I know what it does, but I'm more interested in its actual education, then compiled it does not change further, just make it into opcode As it stands, or just the pseudo code for the compiler, again, the first has been calculated and by storing it. 6 × 7

assembler (not compiler, though this is very similar) 6 * 7 bit As 42 and then the instructions are:

  MOV EAX, [ebx + 42]  

This processor can execute, ebx < / Code> By registering and continuously adding content of 42, using that code to load eax . There are no instructions which encode 6 and 7 as separate entities, which are subsequently multiplied.

LEA is a genuine instruction as any other. Again, the assembler processor can handle the static (working for stable values) to get the statement in a useful format for the processor.

You only have to think about the instructions:

  mov ax, 1 + 1 + 1 + 1 + 1 + 1 + 1  

It will not be encoded as some (magical) sequence of bytes eb 01 01 01 01 01 01 01 , it will be encoded as one of the following:

  mov ax, 7 mov ax, 49-42 wax ax, 42/6  

Comments