Build segments in opcode

I noticed that segment codes use opcodes.

Example:

MOV DWORD PTR SS:[EBP-30],30

I think "PTR SS:" is used to indicate that the EBP-30 is coming from the stack? (SS: stack segment) Am I right, or am I completely wrong? :) And, could you tell me the difference between the above example and

MOV DWORD PTR[EBP-30],30

What about the DS (data segment) used in opcodes?

+5
source share
2 answers
MOV DWORD PTR SS:[EBP-30],30

There are two separate modifiers, DWORD PTRand SS:.

The first tells us that we want to keep the word at the address it points to. This is necessary when the assembler cannot say this from the operands of the instruction. There 30may also be a byte for storage.

SS: - , , . , ESP EBP. , .

EBX EBP, !

+13
  • SS -
  • DS -
  • PTR - . .

mov ax, some_variable

"mov ax, ds:[pointer_to_variable]"

SS DS, :). . DS, SS, CS, - ES. ​​

+8

All Articles