10x Logical Instructions-problems

download 10x Logical Instructions-problems

of 1

Transcript of 10x Logical Instructions-problems

  • 7/25/2019 10x Logical Instructions-problems

    1/1

    LOGICAL INSTRUCTIONS PROBLEMS

    INSTRUCTIONS: Perform the indicated operations (show solutions and give

    required or sample data whenever necessary). Check all solutions

    by writing and executing the corresponding assembly codes.

    1. Invert 7B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. NEGate 55. . . . . . . . . . . . . . .

    3. BC 4. 6E 5. 55

    AND 6A OR 35 XOR 3F

    6. Devise a mask which, used with the:

    a. AND instruction, would allow all bits to pass through unaltered except the

    LSB. The LSB should be cleared. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .b. OR instruction, would allow all bits to pass through unaltered except the 2

    most significant bits. The 2 MSBs should be set. . . . . . . . . . . . . . . . . . . . . . . .

    c. XOR instruction, would invert all bits except the 3 least significant bits. The

    3 LSBs should pass through unaltered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    7. Write an assembly program to solve the following:

    a. Place AAAA6969 somewhere in RAM and then AND it with C0C00F0F.

    b.

    Store the result in a nearby RAM address.

    c.

    Invert every other nibble, starting at the LSB, of the same data stored in

    RAM (given in a.) and copy the result in the next RAM address.

    d. Display all the data stored in the memory locations.