官术网_书友最值得收藏!

Counter

ECX register - also known as counter register. This register is used in loops as a loop iteration counter. It is first loaded with a number of iterations, and then decremented each time the loop instruction is executed until the value stored in ECX becomes zero, which instructs the processor to break out of the loop. We can compare this to the do{...}while() clause in C:

int ecx = 10; 
do
{
// do your stuff
ecx--;
}while(ecx > 0);

Another common usage of this register, actually the usage of its least significant part, CL, is in bitwise shift operations, where it contains the number of bits in which the source operand should be shifted. Consider the following code, for example:

mov eax, 0x12345
mov cl, 5
shl eax, cl

This would result in the register EAX being shifted 5 bits to the left (having the value of 0x2468a0 as a result).

主站蜘蛛池模板: 白水县| 东宁县| 广丰县| 沧源| 密山市| 通州市| 汤原县| 工布江达县| 河津市| 潢川县| 水城县| 林周县| 永康市| 九龙城区| 牟定县| 许昌县| 枣强县| 望城县| 龙川县| 商水县| 江孜县| 余江县| 历史| 襄樊市| 冀州市| 锡林郭勒盟| 蒲江县| 凤山市| 万荣县| 娱乐| 东平县| 康乐县| 楚雄市| 威远县| 彭州市| 海晏县| 津南区| 彩票| 出国| 凉山| 卢湾区|