ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 163

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
wait
Code: 23 F6
Description: Perform the first par t of a semaphore wait (or P) on the semaphore
pointed to by Areg. If the semaphore count is non-zero then the count is decremented
and the process continues; otherwise the current process is added to the back of the
semaphore list ready for the current process to be descheduled. The instruction
returns a boolean value in Areg stating whether a process deschedule is required.
The instruction should be used in the following sequence:
Definition:
Status Register:No effect
Comments:
See also: signal stop
if (word[Areg @ s.Count]
{
}
else
{
}
Breg
Creg
where frontptr = word[Areg @ s.Front]
Secondary instruction.
Areg must be word-aligned.
The semaphore structure should be in fast memory if interrupt latency is critical.
Chapter 7 .
ld semptr; wait; cj continue; stop; continue:
word [Areg @ s.Count]
Areg
if (frontptr
{
}
else
{
}
Areg
word [Areg @ s.Front ]
word [Areg @ s.Back ]
word [backptr @ pw.Link]
word [Areg @ s.Back ]
backptr = word[Areg @ s.Back]
true
undefined
undefined
NotProcess)
false
0)
word[Areg @ s.Count] 1
Tdesc
Tdesc
Tdesc
Tdesc
-- queue empty so add to queue
-- queue not empty so add to back of queue
8 Instruction Set Reference
163/205
wait

Related parts for ST20-C1