The following is a piece of loop code I am trying analyze and understand how loops work:
;the ecx register is the loop counter
mov ecx,6
mov edx, offset space
myloop:
mov eax,ecx
dec eax
call writedec
call writestring
loop myloop
call crlf
mov ecx,6
mov edx, offset space
myloop2:
mov eax,6
sub eax, ecx
call writedec
call writestring
loop myloop2
My questions are:
- What does
offset space
mean? - What does
mov edx, offset space
mean? - I don't understand how the
offset space
is the source? - How do you move register
ecx
into registereax
? - Why is the
offset space
the source and registeredx
the destination?
Thank you so much for all your help.