Question: A2 COMPUTING MODULE 4 AQAWatch
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.
What do u mean by MASK ???
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).
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.
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.