Although the maximum mode and the 8288 bus controller were introduced in
Chap. 8, their multiprocessing features were not consideredat that point.
Because the 8086 has a 6-byte instruction queue and the 8088 has a
4-byte queue, the instruction that has just been fetched may not be
executed immediately.In order to allow external logic to monitor the
execution sequence, a maximum mode 8086/8088 outputs the queue status
through its QS1 and QS0 pins.During each clock cycle the queue status
is examined and the QS1 and QS0 bits are encoded as follows:
00 - No instruction was taken from the queue.
01 - The first byte of the current instruction was taken from the queue.
10 - The queue was flushed because of a transfer instruction.
11 - A byte other than the first byte of an instruction was taken from the queue.
MOV AL,0
TRYAGAIN: XCHG SEMAPHORE,AL
TEST AL,AL
JZ TRYAGAIN
. } Critical section in which a process
. } accesses a shared resource
. }
MOV SEMAPHORE,1
This implementation works fine for a system in which all of the processes
are executed by the same processor, because the processor cannot switch
from one process to another in the middle of an instruction.
TRYAGAIN: XCHG SEMAPHORE,ALand
TEST AL,ALinstruction will cause the JZ instructions to fail.Therefore, both processors will enter their critical sections of code.
| PRETHODNA FOLIJA | SADRZAJ | SLEDECA FOLIJA |