8 Instruction Set Reference
dequeue
dequeue a process
Code: 23 F8
Description: Load into Breg a pointer to the first process from the queue control
block pointed to by Areg. Load into Areg a boolean value indicating whether a
process was found. The queue control block is defined in Chapter 7.
Definition:
if (frontptr = NotProcess)
-- queue is empty
{
Areg′ ← false
Breg′ ← undefined
}
else
-- queue is not empty
{
Areg′ ← true
Breg′ ← frontptr
if (frontptr = backptr)
-- one process on queue
word′[Areg @ q.FPtrLoc]← NotProcess
else
-- many processes on queue
word′[Areg @ q.FPtrLoc]← word[ frontptr @ pw.Link ]
}
Creg′ ← undefined
where frontptr = word[Areg @ q.FPtrLoc]
backptr = word[Areg @ q.BPtrLoc]
Status Register:
No effect
Comments:
Secondary instruction.
This instruction may require 4 memory accesses. If the queue structure is in off-
chip memory then interrupt latency may be affected.
Areg must be word aligned (i.e. divisible by 4).
See also: enqueue run
Chapter 7.
101/205
®