1 / 6

Logical instructions

Logical instructions. And rd rs rt Nor rd rs rt Or rd rs rt Xor rd rs rt Andi rt rs Imm Ori rt rs Imm Xori rt rs Imm Careful: Immediate variants Zero-extend. How to invert each bit?. Nor fuction A B C 0 0 1 0 1 0 1 0 0 1 1 0. (One's complement) Nor rd rs $0

jadzia
Download Presentation

Logical instructions

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. Logical instructions • And rd rs rt • Nor rd rs rt • Or rd rs rt • Xor rd rs rt • Andi rt rs Imm • Ori rt rs Imm • Xori rt rs Imm • Careful: Immediate variants Zero-extend

  2. How to invert each bit? Nor fuction A B C 0 0 1 0 1 0 1 0 0 1 1 0 (One's complement) • Nor rd rs $0 • This is not! A 1 C=A' B=0

  3. Shift instructions Logical shift left Logical shift right A B C D A B C D lost 0 lost 0 B C D 0 0 A B C

  4. Shift instructions • Arithmetic shift right A B C D lost A A B C

  5. Shift instructions • Sll rd rt expr Sra rd rt expr Srl rd rt expr • rd := rt shifted by expr (0..31) • Sllv rd rt rs Srav rd rt rs Srlv rd rt rs • rd := rt shifted by rs (variable)

  6. Rotate instructions Rotate left Rotate right A B C D A B C D B C D A D A B C

More Related