Regarding your posting:
http://groups.google.co.uk/group/comp.sys.transputer/browse_thread/thread/6243760919d4b425?hl=en#
Well here's the answer. The odd 0x00000008, 0x00000004, 0x00000008
cycling seen in your program is all due to the first gajw instruction.
There is a undocumented feature in early Inmos silicon (T414/T800).
As per Inmos datasheet - C coding:
temp = Areg;
Areg' = Wdesc & 0xfffffffc; /* Areg loaded with Wptr (word aligned)
*/
Wdesc' = (Areg & 0xfffffffe) | (Wdesc & 0x00000001);
Oreg' = 0;
Iptr' = NextInst
Well the actual real hardware (i.e. T414 / T800) is as follows - C
coding:
temp = Areg;
Areg' = Wdesc & 0xfffffffc; /* Areg loaded with Wptr (word aligned)
*/
Wdesc' = (Wdesc & 0x00000001) + temp;
Oreg' = 0;
Iptr' = NextInst
Hence in the real gajw instruction if the Areg bit 0 =1 then that
causes the fun and games! Normally the Areg (i.e. a new wptr) is word
aligned (lower two bits '00'). The Areg lsb = 1 causes a toggling of
the proc priority (low to high and high to low), since the original
Wdesc bit 0 (proc priority) is added to the Areg, before being
transferred into the updated Wdesc.
Hence, if you add the following code sequence you can toggle the proc
priority.
Ldc #1
gajw
gajw
If the transputer is executing a high priority task (Wdesc bit 0=0)
before the sequence, afterwards it wil be a low priority task (Wdesc
bit 0 = 1).
If the transputer is executing a low priority task (Wdesc bit 0=1)
before the sequence, afterwards it wil be a high priority task (Wdesc
bit 0 = 0).
I have included this gajw trick in the latest release of the emulator
- jserver v2.7 which can be found on my website:
http://sites.google.com/site/transputeremulator/
Glad to have been of help! ;-)
Regards
Gavin
> Glad to have been of help! ;-)
Kick-ass! That's the explanation - Great!!
Remains with two questions in my brain:
1) Whow did you discover this microcode speciality?
2) Does a real transputer really handle the current process (after a
switch from low to high) as a high priority process in case of
timeslicing?
Congratulation
Mike