Handmade Hero » Forums » Code » Visual Studio: Memory Window
Kirk Friend
2 posts
#14443 Visual Studio: Memory Window
2 weeks, 2 days ago Edited by Kirk Friend on March 7, 2018, 6:35 p.m. Reason: Initial post


I have just started following the Handmade Hero video series and Casey has covered quite a fair bit regarding the computers memory and how it works.

I am having difficulty understanding the VS memory window. I am looking a simple add instruction at location 0040173D which I believe is 3 bytes or 24 bits (83 C0 01). My memory window is set to display 1-byte integers and hexadecimal display and positioned at address 0040173D. I see '83 C0 01' first in the row but then I see a lot of other data. Is this all located at the same memory address?

Looking at the next instruction and address within the disassembly 00401740 has 3 bytes '89 45 F8' but I see this in the same row as my previous 3 bytes for the last instruction regardless of the address being different.

What am I actually looking at, does each instruction have it's own memory address or can instructions share addresses?

340 posts
#14444 Visual Studio: Memory Window
2 weeks, 2 days ago

each byte has its own address, the byte at location 0040173D is 83 the byte at location 0040173E (the next one) is C0 and the byte at location 0040173F is 01 the following byte again 00401740 is 89

when you jump to a location in the memory window it will also show the memory around it. Most of the time a programmer wants to look at a bunch of data around a specific location for example to look at the contents of a buffer that got read in.

Kirk Friend
2 posts
#14453 Visual Studio: Memory Window
2 weeks, 1 day ago

I think I understand now. The memory address is the beginning of the data. Thanks.