Does a constant expression then return a constant value?
Yes. An immediate operand creates a constant value in an opcode. Like mov eax, 3
creates an opcode consisting of several bytes - according to x32/x64 Intel Manual.
B0+ rb ib MOV r8, imm8 OI Valid Valid Move imm8 to r8.
B8+ rw iw MOV r16, imm16 OI Valid Valid Move imm16 to r16.
B8+ rd id MOV r32, imm32 OI Valid Valid Move imm32 to r32.
C6 /0 ib MOV r/m8, imm8 MI Valid Valid Move imm8 to r/m8.
C7 /0 iw MOV r/m16, imm16 MI Valid Valid Move imm16 to r/m16.
C7 /0 id MOV r/m32, imm32 MI Valid Valid Move imm32 to r/m32.
For example: For 32-bit-mode the following byte combinations do represent the valid opcodes. This means for mov destination, 3
there are several possibilities:
b0 03 mov al, 3
66 b8 03 00 mov ax, 3
b8 03 00 00 00 mov eax, 3
c6 45 00 03 mov byte ptr [xxx], 3
66 c7 45 00 03 00 mov word ptr [xxx], 3
c7 45 00 03 00 00 00 mov dword ptr [xxx], 3
B0h and B8h represent a one-byte opcode, C6h and C7h represent a two-byte opcode consisting of an opcode byte and a Mod/RM-byte coding the addressing mode - in this case indirect addressing
. 66h
designates an Operand-Size Prefix
indicating that the following instruction uses an 16-bit(out-of-address-mode) operand - an exception compared to the normal 32-bit mode operand. An 8-bit operand is encoded with another opcode. The remaining bytes are the encoding of a 8/16/32-bit value of 3
.
Does inline value mean that it will be substituted by some other value after having undergone the process of assembly?
No. Assembl(y|ing) is the process of incorporating constant values into resulting opcodes(seqeunces of bytes). In a way, everything is inline in assembly.