Retrieving Memory Offset Address Using Assembly
I'm trying to retrieve the offset address开发者_如何学运维 of a memory variable
this is wat i did
Mov CX, OFFSET data
but the offset data gave its 0000, may i ask why?
It is correct.. 0000 refers to the offset from the beginning of the data segment. So the offset is ds:0000 (this is the logical address). To get the physical address you have to multiply by 16 the segment (ds) then add the offset (0000 in this case) if I remember correctly. Have a look here for more info about the logical addresses and here for the physical addresses.
精彩评论