I have recently started to learn assembly and I keep on coming across a certain syntax which i don't fully understand and after spending hours researching I find the syntax in code but no explanation so I was hoping someone could explain.

I see it in many instructions but for an example i will use SUB.

SUB EAX, DWORD PTR DS:[78E32C]

.

My understanding is that this would subtract the value at memory address 0078E32Ch from the EAX register. However I do not understand what the DS means. I sometimes also see SS in the same place of DS.

It has been bugging me now. Is is not as correct just to use:

SUB EAX, DWORD PTR [78E32C]

.

My guess is from the : syntax is that it means the memory segment referred to in the DS segment register, so in fact it means the memory address DS:0078E32C but I can't find anything that confirms this.

Am I wrong in thinking this?

Thanks for any comments and I apologise for such a basic question.

It's probably the indeed that. DS: Data Segment, so it'd be.. DS + [78E32C]. I can't think of anything else, pretty sure it's that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.