Answer the question
In order to leave comments, you need to log in
How does this assembler code work?
this code is working but
mov eax,0
do:
mov edx,48
add edx,eax
mov dword [temp+eax],edx
inc eax
cmp eax,10
jne do
Answer the question
In order to leave comments, you need to log in
In C, this looks something like
int temp[10];
int i ;
for ( i = 0; i != 10; ++i)
{
temp[i] = i + 48;
//Not sure, maybe even *(int*)((char*)temp + i) = i + 48
}
The only doubt about +eax... To index dword, it seems like you need to multiply by 4 more
In any case, eax is modified only in inc command
The mov command only moves data. In this case - will place the value of EDX at the address equal to the sum of the address of the temp area and EAX. The recording point is moved in the inc command - and here is the magic :) I don’t see the temp description, but I have to move inc by the length of the type description, as far as I remember ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question