90 likes | 197 Views
CS 206D Computer Organization Lab4. Logic Instructions. Logic instructions. Logic instructions. AND destination , source OR destination , source XOR destination , source NOT destination. AND.
E N D
CS 206D Computer Organization Lab4 CS 111
Logic Instructions Logic instructions CS 111
Logic instructions • ANDdestination, source • ORdestination, source • XORdestination, source • NOTdestination CS 111
AND CS 111 • The AND instruction can be used to clearspecific Destination bits while preserving the others. • A zeromask bit clears the corresponding Destination bit • A onemask bit preserves the corresponding destination bit.
OR CS 111 The OR instruction can be used to setspecific Destination bits while preserving the others. A one mask bit sets the corresponding Destination bit A zero mask bit preserves the corresponding Destination bit.
XOR CS 111 • The XOR instruction can be used to invertspecific Destination bits while preserving the others. • A onemask bit inverts the corresponding Destination bit • A zeromask bit preserves the corresponding Destination bit.
Programming questions – q 1 • Declare data and display prompt message CS 111
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
Programming questions – q 1 (Cont.) • Output the content of BX in HEX. CS 111