KDBG version: 3.0.1.
I have a 10x10 matrix defined in C, such as: char myArray[10][10] = { ' ', 'x', ... }
, used on ASM.
In ASM I use the following line to compare the value of two chars:
cmp BYTE[myArray+rax], 'x'
inc rax
rax, initialized to 0 is used as loop counter and relative address displacement, both up to the number 100 (because the array in memory is 10*10=100 bytes long, right?)
So the idea is when rax is incremented by 1 (byte), in the cmp instruction I'm accessing the next element in myArray.
Now, in the KDBG Watched expressions panel, when using (&myArray+$rax)
I expect to see the value of the element I'm accessing, yet I cannot accomplish that.
Tried:
- Independent from rax value:
&myArray
, shows the starting address: (char)(*)[10][10] 0x5050a0 <myArray>
, and some values comma separated. Can't tell if it is all of them.
- When rax=5, for example:
(&myArray+$rax)
, address: (char)(*)[10][10] 0x505294 <anotherArray+52>
, there is a difference of 500 from the starting address and it is referencing another array I declared in C.
I'm not sure if this question is KDBG syntax related or my understanding of how arrays in asm work is wrong. Any help appreciated.