CS 206D Computer Organization Lab4 CS 111
Logic instructions Logic Instructions CS 111
AND destination, source OR destination, source XOR destination, source Logic instructions AND destination, source OR destination, source XOR destination, source NOT destination CS 111
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
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
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
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