Turn on thread page Beta

    Well i dont understand this question....
    A Process can only Begin if bits 0 (least significant bit) and 4 of register are set to 1, and bits 2 and 3 are set to 0. The status of the other four bits has no effect on the process.

    7 6 5 4 3 2 1 0
    1 0 0 1

    Write the key assembly language instructions to check whether the process can take place.

    The 1 should appear below the 4, followed by a 0 below the 3, followed by a 0 below the 2, the 1 should be blank, the 0 has 1 below it...the others are blank

    You need to use a mask of AND operation
    then compare bits

    You need to use a mask of AND operation

    What do u mean by MASK ???

    A mask is simply a sequence of bits used to read or set bits by applying logical (AND/OR) operations to the contents of a word.

    e.g. a purely fictitious example:
    00100101 is a byte given to you, you are asked to write instructions to ensure the output is ###1###1 (where # is irrelavant, it can be 1 or 0 - doesnt matter).

    OR Masking

    So if you were to use an OR operation:
    Original number: 00100101
    OR with: 00010001
    It would ensure you get ###1###1, because whether bits 0 and 4 were 1 or 0, it would result in 1, because of the nature of the OR operation.

    AND Masking

    Using an AND operation allows you to do the opposite, and can ensure certain bits are set to 0. If and AND operation is carried out with 0, the result will always be a 0 (both bits need to be 1 in order for 1 to be the result). Using a 1, will only output in a 1 if the original bit is also 1. In the above example if you did an AND operation with 00010001, and used a CMP (compare) instruction with the pattern required you could branch it somewhere if it was equal (pattern is correct) or branch it elsewhere if they dont match.
Were you ever put in isolation at school?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.