logic shift and rotate instruction

17
Presented to: Prof. Muhammad Ramiz Presented by: Wajeeha Ali(90) Afira Rashid (93) Amna jutt(98) Zarish zahid (81)

Transcript of logic shift and rotate instruction

Page 1: logic shift and rotate instruction

Presented to:Prof. Muhammad Ramiz

Presented by:Wajeeha Ali(90)Afira Rashid (93)Amna jutt(98)Zarish zahid (81)

Page 2: logic shift and rotate instruction

Wajeeha Ali(G1F15BSCS0090)

Page 3: logic shift and rotate instruction

Logic, Shift, and Rotate Instructions

Page 4: logic shift and rotate instruction

Logic instruction

To manipulate individual bits Binary Value 0 treated as false Binary Value 1 treated as true

AND OR XOR NOT TEST

Page 5: logic shift and rotate instruction

SHIFT AND ROTATE INSTRUCTION:

Shift:Shift the bits in destination operand by one or more positions either to the left or right.

Page 6: logic shift and rotate instruction

Syntax:

SHL DESTINATION,CLSAL DESTINATION,CLSHR DESTINATION,CLSAR DESTINATION,CL

Page 7: logic shift and rotate instruction

ROTATE:

Bit shifted out from one end of the destination operand is put back on the other end.

Page 8: logic shift and rotate instruction

SYNTAX:

ROL DESTINATION,CLROR DESTINATION,CL

Page 9: logic shift and rotate instruction

Program:

An AL Program that prompts the user to enter two binary numbers of up to 8 digits each, and print their sum on the next line in binary. If the user enters an illegal character, he or she should be prompted to begin again. Each input ends with a carriage return.

Page 10: logic shift and rotate instruction
Page 11: logic shift and rotate instruction
Page 12: logic shift and rotate instruction
Page 13: logic shift and rotate instruction
Page 14: logic shift and rotate instruction
Page 15: logic shift and rotate instruction
Page 16: logic shift and rotate instruction
Page 17: logic shift and rotate instruction