1 / 12

Chapter Four 80x86 Instruction Set ( 5 )

Chapter Four 80x86 Instruction Set ( 5 ). Logical, Shift, Rotate Instructions. The 80x86 family provides--- five logical instructions: and, or, xor, test, and not ; four rotate instructions: ror, rol, rcr, and rcl ; three shift instructions. shl/sal, shr, and sar.

callum
Télécharger la présentation

Chapter Four 80x86 Instruction Set ( 5 )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter Four80x86 Instruction Set(5) 2014年10月20日1

  2. Logical, Shift, Rotate Instructions • The 80x86 family provides--- • five logical instructions: and, or, xor, test, and not; • four rotate instructions: ror, rol, rcr, and rcl; • three shift instructions. shl/sal, shr, and sar. 2014年10月20日2

  3. The Logical Instructions: AND, TEST,OR, XOR, and NOT • and dest, source ;dest := dest and source • testdest, source ; dest and source • or dest, source ;dest := dest or source • xor dest, source ;dest := dest xor source • not dest ;dest := not dest 2014年10月20日3

  4. The Shift Instructions: SHL/SAL, SHR, SAR • The 80x86 supports three different shift instructions (shl and sal are the same instruction): • shl (shift left), • sal (shift arithmetic left), • shr (shift right), • sar (shift arithmetic right). • The 80386 and later processors provide two additional shifts: shld and shrd. 2014年10月20日4

  5. The Shift Instructions: SHL/SAL, SHR, SAR • The shift instructions move bits around in a register or memory location. The general format for a shift instruction is • shl dest, count • sal dest, count • shr dest, count • sar dest, count 2014年10月20日5

  6. The Shift Instructions: SHL/SAL, SHR, SAR • shl reg, 1 • shl mem, 1 • shl reg, cl • shl mem, cl • sal is a synonym for shl and uses the same formats. • shr uses the same formats as shl. • sar uses the same formats as shl. 2014年10月20日6

  7. The Shift Instructions: SHL/SAL, SHR, SAR 2014年10月20日7

  8. The Rotate Instructions: RCL, RCR, ROL, and ROR The rotate instructions shift the bits around, just like the shift instructions, except the bits shifted out of the operand by the rotate instructions recirculate through the operand. They include rcl (rotate through carry left), rcr (rotate through carry right), rol (rotate left), and ror (rotate right). These instructions all take the forms: rcl reg, 1 rcl mem, 1 rcl reg, cl rcl mem, cl 2014年10月20日8

  9. RCL 2014年10月20日9

  10. RCR 2014年10月20日10

  11. ROL 2014年10月20日11

  12. ROR 2014年10月20日12

More Related