Search code examples
assemblyx86memory-addressaddressing-mode

Do offsets in assembly represent addresses or bits?


I am a bit confused, will inc [esi + 8] (lets say [esi] points to 0x0000001F in 8-bit memory) increment 0x00000027 or will it affect 0x00000020? I have seen a video implying it will affect the latter whereas regular pointers in ram go by addresses, not bits.

Edit: so sorry for this incredibly stupid question please restore my right to post


Solution

  • Addresses are bytes. This will increment 0x00000027.

    This doesn't assemble because you're missing the size though. inc {byte|word|dword|qword} ptr [esi + 8] is what you want. (Operand size is required)