Consider the following data segment .data array1 WORD 10 DUP(?),0,0 array2 DWORD 4 DUP(3 DUP(?)) What decimal value the instruction : mov EBX , SIZEOF array2 stores in EBX. Show your work for full credit.
The following instruction array2 DWORD 4 DUP(3 DUP(?) declares array of unsigned integers each of length 32-bits or 4 bytes.
The SIZEOF operator returns a value that is equivalent to multiplying value returned by LENGTHOF by Type
The LENGTHOF operator returns the number of elements in a single data declaration. In our example LENGTHOF will return 12 because there are total 12 DWORDS in the array. Because of two DUP operators internal DUP create three DWORDs and the external DUP repeats these three DWORDS 4 times therefore 12 DWORDS in total.
Since Type in our example is DWORD and each DWORD is of 4 bytes thus SIZEOF operator will return 12*4 i.e 48
Therefore the instruction : mov EBX , SIZEOF array2 stores the decimal value of 48 in EBX.
Get Answers For Free
Most questions answered within 1 hours.