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:
Blood
  • 4,126
  • 3
  • 27
  • 37
Jessica
  • 11
  • 1
  • 2
  • DWORD PTR says that register which you will use is exactly this type, but for me something is missing here. – Blood Mar 17 '13 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 '13 at 21:22

1 Answers1

1

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

Vlad Krasnov
  • 1,027
  • 7
  • 12