INTEL汇编指令集(8)

2019-01-26 19:06

REP - Repeat String Operation Usage: REP

Modifies flags: None

Repeats execution of string instructions while CX != 0. After each string operation, CX is decremented and the Zero Flag is

tested. The combination of a repeat prefix and a segment override on CPU's before the 386 may result in errors if an interrupt occurs before CX=0. The following code shows code that is susceptible to this and how to avoid it:

again: rep movs byte ptr ES:[DI],ES:[SI] ; vulnerable instr.

jcxz next ; continue if REP successful loop again ; interrupt goofed count next:

Clocks Size Operands 808x 286 386 486 Bytes none 2 2 2 1

REPE/REPZ - Repeat Equal / Repeat Zero Usage: REPE REPZ

Modifies flags: None

Repeats execution of string instructions while CX != 0 and the Zero Flag is set. CX is decremented and the Zero Flag tested after each string operation. The combination of a repeat prefix and a segment override on processors other than the 386 may result in errors if an interrupt occurs before CX=0.

Clocks Size Operands 808x 286 386 486 Bytes none 2 2 2 1

REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero Usage: REPNE REPNZ Modifies flags: None

Repeats execution of string instructions while CX != 0 and the Zero Flag is clear. CX is decremented and the Zero Flag tested after each string operation. The combination of a repeat prefix and a segment override on processors other than the 386 may result in errors if an interrupt occurs before CX=0.

Clocks Size Operands 808x 286 386 486 Bytes none 2 2 2 1

RET/RETF - Return From Procedure

Usage: RET nBytes RETF nBytes RETN nBytes Modifies flags: None

Transfers control from a procedure back to the instruction address saved on the stack. \ release. Far returns pop the IP followed by the CS, while near returns pop only the IP register.

Clocks Size Operands 808x 286 386 486 Bytes retn 16/20 11+m 10+m 5 1 retn immed 20/24 11+m 10+m 5 3 retf 26/34 15+m 18+m 13 1 retf (PM, same priv.) - 32+m 18 1 retf (PM, lesser priv.) - 68 33 1

retf immed 25/33 15+m 18+m 14 3 retf immed (PM, same priv.) 32+m 17 1 retf immed (PM, lesser priv.) 68 33 1

ROL - Rotate Left

Usage: ROL dest,count Modifies flags: CF OF +-+ +---------------+ |C|<++-+|7 <---------- 0|<-+ +-+ | +---------------+ | +---------------------+

Rotates the bits in the destination to the left \ all data pushed out the left side re-entering on the right. The Carry Flag will contain the value of the last bit rotated out. Clocks Size Operands 808x 286 386 486 Bytes reg,1 2 2 3 3 2

mem,1 15+EA 7 7 4 2-4 (W88=23+EA) reg,CL 8+4n 5+n 3 3 2

mem,CL 20+EA+4n 8+n 7 4 2-4 (W88=28+EA+4n) reg,immed8 - 5+n 3 2 3 mem,immed8 - 8+n 7 4 3-5

ROR - Rotate Right

Usage: ROR dest,count Modifies flags: CF OF

+---------------+ +-+ +->|7 +---------> 0|+-+->|C| | +---------------+ | +-+

+---------------------+

Rotates the bits in the destination to the right \ all data pushed out the right side re-entering on the left. The Carry Flag will contain the value of the last bit rotated out. Clocks Size Operands 808x 286 386 486 Bytes reg,1 2 2 3 3 2

mem,1 15+EA 7 7 4 2-4 (W88=23+EA) reg,CL 8+4n 5+n 3 3 2

mem,CL 20+EA+4n 8+n 7 4 2-4 (W88=28+EA+4n) reg,immed8 - 5+n 3 2 3 mem,immed8 - 8+n 7 4 3-5

SAHF - Store AH Register into FLAGS Usage: SAHF

Modifies flags: AF CF PF SF ZF

Transfers bits 0-7 of AH into the Flags Register. This includes AF, CF, PF, SF and ZF.

Clocks Size Operands 808x 286 386 486 Bytes none 4 2 3 2 1

SAL/SHL - Shift Arithmetic Left / Shift Logical Left Usage: SAL dest,count SHL dest,count

Modifies flags: CF OF PF SF ZF (AF undefined) +-+ +---------------+ +-+ |C|<---+|7 <---------- 0|<---+|0|

+-+ +---------------+ +-+

Shifts the destination left by \ in on right. The Carry Flag contains the last bit shifted out. Clocks Size Operands 808x 286 386 486 Bytes reg,1 2 2 3 3 2

mem,1 15+EA 7 7 4 2-4 (W88=23+EA) reg,CL 8+4n 5+n 3 3 2

mem,CL 20+EA+4n 8+n 7 4 2-4 (W88=28+EA+4n) reg,immed8 - 5+n 3 2 3 mem,immed8 - 8+n 7 4 3-5

SAR - Shift Arithmetic Right

Usage: SAR dest,count

Modifies flags: CF OF PF SF ZF (AF undefined) +---------------+ +-+

+-+|7 ----------> 0|---+>|C| | +---------------+ +-+ +---^

Shifts the destination right by \ bit replicated in the leftmost bit. The Carry Flag contains the last bit shifted out.

Clocks Size Operands 808x 286 386 486 Bytes reg,1 2 2 3 3 2

mem,1 15+EA 7 7 4 2-4 (W88=23+EA) reg,CL 8+4n 5+n 3 3 2

mem,CL 20+EA+4n 8+n 7 4 2-4 (W88=28+EA+4n) reg,immed8 - 5+n 3 2 3 mem,immed8 - 8+n 7 4 3-5

SBB - Subtract with Borrow/Carry Usage: SBB dest,src

Modifies flags: AF CF OF PF SF ZF

Subtracts the source from the destination, and subtracts 1 extra if the Carry Flag is set. Results are returned in \

Clocks Size Operands 808x 286 386 486 Bytes reg,reg 3 2 2 1 2

mem,reg 16+EA 7 6 3 2-4 (W88=24+EA) reg,mem 9+EA 7 7 2 2-4 (W88=13+EA) reg,immed 4 3 2 1 3-4

mem,immed 17+EA 7 7 3 3-6 (W88=25+EA) accum,immed 4 3 2 1 2-3

SCAS - Scan String (Byte, Word or Doubleword) Usage: SCAS string SCASB SCASW

SCASD (386+)

Modifies flags: AF CF OF PF SF ZF

Compares value at ES:DI (even if operand is specified) from the accumulator and sets the flags similar to a subtraction. DI is incremented/decremented based on the instruction format (or operand size) and the state of the Direction Flag. Use with REP prefixes.

Clocks Size Operands 808x 286 386 486 Bytes

string 15 7 7 6 1 (W88=19)

SETAE/SETNB - Set if Above or Equal / Set if Not Below (386+) Usage: SETAE dest SETNB dest (unsigned, 386+) Modifies flags: none

Sets the byte in the operand to 1 if the Carry Flag is clear otherwise sets the operand to 0.

Clocks Size Operands 808x 286 386 486 Bytes reg8 - - 4 3 3 mem8 - - 5 4 3

SETB/SETNAE - Set if Below / Set if Not Above or Equal (386+) Usage: SETB dest SETNAE dest (unsigned, 386+) Modifies flags: none

Sets the byte in the operand to 1 if the Carry Flag is set otherwise sets the operand to 0.

Clocks Size Operands 808x 286 386 486 Bytes reg8 - - 4 3 3 mem8 - - 5 4 3

SETBE/SETNA - Set if Below or Equal / Set if Not Above (386+) Usage: SETBE dest SETNA dest (unsigned, 386+) Modifies flags: none

Sets the byte in the operand to 1 if the Carry Flag or the Zero Flag is set, otherwise sets the operand to 0.

Clocks Size Operands 808x 286 386 486 Bytes reg8 - - 4 3 3 mem8 - - 5 4 3

SETE/SETZ - Set if Equal / Set if Zero (386+) Usage: SETE dest SETZ dest Modifies flags: none

Sets the byte in the operand to 1 if the Zero Flag is set, otherwise sets the operand to 0.

Clocks Size Operands 808x 286 386 486 Bytes


INTEL汇编指令集(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:肯德基与麦当劳两大快餐帝国的连锁餐饮秘诀

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: