Assembly Segments in opcodes

后端 未结 2 1082
小蘑菇
小蘑菇 2021-02-04 12:44

I noticed that in Assembly segments are used in opcodes.

Example:

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

I think that \"PTR SS:\" is used to spec

2条回答
  •  无人及你
    2021-02-04 12:57

    • SS is Stack Segment
    • DS is Data Segment
    • PTR - pointer. It's an address.

    When you do

    mov ax, some_variable
    

    you are really substituting this form "mov ax, ds:[pointer_to_variable]"

    In case of SS, you are accessing the value not from DS, but from the stack instead :). Think of segment registers as banks. Data comes from DS, Stack data from SS, Code data from CS, Extra segment is ES.

提交回复
热议问题