In assembly, I see an instruction est eax, eax. Whats the point of this ?
The test instruction performs a logical AND of the two operands, without saving the result. The instruction does, however, update the flags. Put in laymans terms, this means that it is an efficient way of testing to see if a register is zero in value. If eax = 0, then test eax, eax will set the Z flag, otherwise Z will be reset. You’ll notice that typically, the test instruction is followed by a jne, je.
Related Questions
- Why are data rails included on the instruction sheet for the Heavy Duty Workstation when they are not needed for assembly of the product?
- Why is the County Assembly suspended at one point in the agenda to hold the Convention and other Assemblies?
- As a Church of Scotland congregation, how can we follow the instruction of the General Assembly 2009?