1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Intel Processor Register

Discussion in 'Assembly Language Programming (ALP) Forum' started by eblack10, Nov 16, 2010.

  1. eblack10

    eblack10 New Member

    Joined:
    Nov 16, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    What are the contents of register al on and intel processor after these instructions?

    mov al, 01010101b
    and al, 00001111b
    or al, 11110000b
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    This isn't difficult. Where are you stuck? Do you understand what AND and OR do? (Presumably not, otherwise finding the answer would be trivial.)
    Truth tables for AND and OR:
    AND:
    a b x
    0 0 0
    0 1 0
    1 0 0
    1 1 1

    OR:
    a b x
    0 0 0
    0 1 1
    1 0 1
    1 1 1

    and these operations are performed on every bit. So, taking them right to left, 1 and 1 is 1, 0 and 1 is 0 etc, so the result is xxxxxx01; we then OR that with 11110000 which gives us xxxxxx01. You can fill in the x's now you know what to do.
     

Share This Page