237388919 Business Grammar

1
TEST (x86 instruction) From Wikipedia, the free encyclopedia In the x86 assembly language , the TEST instruction performs a bitwise AND on two operands . The flags SF , ZF , PF are modified while the result of the AND is discarded. The OF and CF flags are set to 0, while AF flag is undefined. There are 9 different opcodes for the TEST instruction depending on the type and size of the operands . It can compare 8-bit, 16-bit, 32-bit or 64-bit values. It can also compare registers, immediate values and register indirect values. [1] TEST opcode variations[edit ] The TEST operation sets the flags CF and OF to zero. The SF is set to the MSB of the result of the AND . If the result of the AND is 0, the ZF is set to 1, otherwise set to 0. The parity flag is set to the bitwise XNOR of the result of the AND . The value of AF is undefined. Examples[edit ] ; Conditional Jump test cl, cl ; set ZF to 1 if cl == 0 je 0x804f430 ; jump if ZF ==1 ; or test eax,eax ; set SF to 1 if eax < 0 (negative) js error ; jump if SF == 1

description

237388919 Business Grammar

Transcript of 237388919 Business Grammar

Page 1: 237388919 Business Grammar

TEST (x86 instruction)From Wikipedia, the free encyclopedia

In the x86 assembly language, the TEST instruction performs a bitwise AND on two operands. The flags SF, ZF, PF are modified while the result of the AND is discarded. The OF and CF flags are set to 0, while AF flag is undefined. There are 9 different opcodes for the TEST instruction depending on the type and size of the operands. It can compare 8-bit, 16-bit, 32-bit or 64-bit values. It can also compare registers, immediate values and register indirect values.[1]

TEST opcode variations[edit]

The TEST operation sets the flags CF and OF to zero. The SF is set to the MSB of the result of the AND. If the result of the AND is 0, the ZF is set to 1, otherwise set to 0. The parity flag is set to the bitwise XNOR of the result of the AND. The value of AF is undefined.

Examples[edit]

; Conditional Jump test cl, cl ; set ZF to 1 if cl == 0 je

0x804f430 ; jump if ZF ==1 ; or test eax,eax ; set SF to 1 if eax

< 0 (negative) js error ; jump if SF == 1