With this instruction we can implement semaphore as follows:

wait(sem)
  M[sem]--       decrement count
  if( M[sem] < 0 )
    enqueue current process
    block current process  (wfi)

Block the current process is achieved by "wfi"

signal(sem)
  if( M[sem] < 1 ) M[sem]++    increment count
  if( M[sem] <= 0 )
    p = dequeue()
    send interrupt to p  (intx p)


