Download presentation
Presentation is loading. Please wait.
1
CS 206D Computer Organization
Lab4 CS 111
2
Logic instructions Logic Instructions CS 111
3
AND destination, source OR destination, source XOR destination, source
Logic instructions AND destination, source OR destination, source XOR destination, source NOT destination CS 111
4
AND The AND instruction can be used to clear specific Destination bits while preserving the others. A zero mask bit clears the corresponding Destination bit A one mask bit preserves the corresponding destination bit. CS 111
5
OR The OR instruction can be used to set specific Destination bits while preserving the others. A one mask bit sets the corresponding Destination bit A zero mask bit preserves the corresponding Destination bit. CS 111
6
XOR The XOR instruction can be used to invert specific Destination bits while preserving the others. A one mask bit inverts the corresponding Destination bit A zero mask bit preserves the corresponding Destination bit. CS 111
7
Programming questions – q 1
Declare data and display prompt message CS 111
8
Programming questions – q 1 (Cont.)
Read binary number We assume that the input characters are either ‘1’ , ‘0’ or carriage return. And at most 16 bits are input. CS 111
9
Programming questions – q 1 (Cont.)
Output the content of BX in HEX. CS 111
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.