You will have to assume that these values are stored contiguously in memory. Then you obtain a pointer to (address of) the first one, and iterate through them by continuously incrementing that pointer by the size of each element.
To know when to stop iterating (i.e., for the loop termination condition), you can either use a counter (because you know that there are a constant 12 elements), or you can check the value to see if it is 700 (then you know you're at the end).
Here is an example that uses a counter:
mov ecx, 0 ; initialize counter
mov edx, OFFSET frequency ; get address of the first element
DoLoop:
mov eax, DWORD PTR [edx] ; get value of the element
... ; do something with that value, now in the EAX register
inc ecx ; increment counter by one
add edx, 2 ; increment pointer by size of an element
cmp ecx, 12 ; compare counter against 12 (total number of elements)
jl DoLoop ; keep looping while less than 12
There are multiple ways to write this loop, some perhaps slightly more optimal than the above code, but that should give you the idea.
If you just want to do a simple "if x != 700" loop, then it is as simple as:
cmp X, 700 ; where X is some register or memory location that you want to test
jne BranchLabel ; where 'BranchLabel' is the label to jump to if X != 700
In general, on x86, you will do a conditional branch using a CMP
instruction to set the flags, followed by a Jcc
instruction that actually does the branching (where cc
is a condition code that specifies how the flags are to be tested).
However, you do not have to use a CMP
instruction. There are a bunch of other instructions that set flags, including TEST
and nearly all of the arithmetic and bitwise instructions (e.g., ADD
, SUB
, XOR
, etc.) If the flags have already been set, then you can just do the Jcc
directly. There is no need for a redundant comparison!