1

In this snippet of code which is supposed to be a loop break condition, what does cmp DWORD PTR do? What does mov DWORD PTR

mov eax, DWORD PTR [c]
mov ecx, DWORD PTR [array] 
LoopStart:
cmp DWORD PTR
jne AfterLoop // break
mov DWORD PTR
add eax, 1
cmp eax, 1000 // post-test 
jl LoopStart
AfterLoop:
2
  • DWORD PTR says that register which you will use is exactly this type, but for me something is missing here.
    – Blood
    Mar 17, 2013 at 14:51
  • look at the encoding of the mov and cmp instructions, there are various different versions of the instruction, in order to get the assembler to create the proper instruction you need to tell the assembler what the register points to (byte, word, dword).
    – old_timer
    Mar 17, 2013 at 21:22

1 Answer 1

1

It just tells the assembler, that the pointer is to a 32-bit value. But in your code you have missing arguments.

1
  • I thought that the arguments are missing but I was not sure.
    – Jessica
    Mar 17, 2013 at 21:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.