X86 memory allocation assembly language

Yesterday I learned about the SIZEOF and TYPE statements. In doing so, I created an array,

Array QWORD 1h,2h,3h,4h,5h

and in the .code section, I wrote,

MOV eax, SIZEOF Array

After the build, it is inconvenient that I received only 28 bytes allocated for the array (using the visual studio 2015 community). I saw register values ​​in a debugging session.

My question is here, each QWORD takes up 8 bytes of memory. Then why didn't I get SIZEOF Array as 40?

Even worse. When I launched this,

Array QWORD 1h

he gave me 8 bytes as expected

Array QWORD 1h,2h

Gives me 10 .. !! AND,

Array QWORD 1h,2h,3h 

Gives me 18 .. !!
Etc...

+4
source share
1 answer

Visual Studio . , 28 0x28? 0x28 40. (, 0x10 16, 0x18 24 ..)

+5

Source: https://habr.com/ru/post/1665170/


All Articles