Answer
See explanation
Work Step by Step
Set and set instruction is used to archive process synchronisation between the concurrent processes, and thus solve the problem of critical section or race condition.
It is important for the entire test-and-set process to be implemented as a single instruction because if that not the case then both the processes (that share some piece of code ) can simultaneously enter the critical section due to premption between the instructions and this can lead to inconsistency in the program.