%
Page Numbers: Yes First Page: 1
Heading:
IfuStepSubrs.mcApril 21, 1982 3:07 PM%
TITLE[ifuStepSubrs];
%
CONTENTS

SUBROUTINE
FUNCTION
iAddFGParityadd parity bit for presentation to FG bus.
itGetPcXSHstep SH for ←PcX’
itIfuJumpSHstep SH for IfuJump[0]
itMakeFDAckSHstep SH for memAck & MakeF←D
itMosFhShstep FH SH for mos←
itMakeFDSHstep SH forMakeF←D
itMemAckFHstep FH for memAck
itMemAckShFhstep SH FH for memAck
itMemAckSHstep SH for memAck
itNewPcFHstep FH for PcF←
itNewPcFhShstep FhSh for PcF←
itNewPcSHstep SH for PcF←
itNextDataSHstep SH for ←ID
itNoopFHstep FH for tick w/ nothing else
itNoopFhShstep FhSh for tick
itNoopSHstep SH for tick
itResetFHstep FH for reset
itResetSHstep SH for reset
itSetFGFDSHStep SH for FG←, makeF←D
itSetFGFHstep FH for FG←
itSetFGSHstep SH for FG←
itStepIfuTest←T, tick

%

%
April 21, 1982 3:07 PM
Change itTick, etc to ukse pushReturn,etc. rather than saveRetukrn[klink].
June 18, 1981 10:00 AM
Move incClock to IfuSubrs.
May 28, 1981 3:01 PM
Change refs from Bmux to BmuxRM to keep midas happy.
June 7, 1979 3:06 PM
Fix typo in itMosFhSh
June 7, 1979 11:15 AM
Create setCtemp, make iAddFGParity global and add a temporary kludge to iAddFGParity so that the parity bit is always zero --since there’s no longer a hardware path from Test into the FGparity computation.
June 6, 1979 6:43 PM
Add missing ; at end if itMemAckSH, before itNewPcFH.
June 6, 1979 6:04 PM
Add comments, look for bug in itNewPcFhSh
April 22, 1979 5:05 PM
Construct this file from Ifu1, Ifu2.
%


* June 7, 1979 3:07 PM
%
test register manipulations

This code performs various operations on the test register, ticks the ifu, etc.
%
m[setCtemp, mc[cTemp, OR[#1!, #2!, #3!, #4!, #5!, #6!]]];* multiple use of this macro will cause harmless, but annoying "errors" during assembly.

top level;
call[itResetFH];* this silly sequence of calls forces the
call[itStep];* subroutines below to occur on call locs
noop;* we never drop thru to next instruction

iAddFGParity:
subroutine;* add FG Parity
* CLOBBERS rscr, rscr2
* OR the proper parity bit into T given that the right byte of T contains the value for FG.
* test.parity causes the 9 bits to have odd parity

rscr2 ← rsh[t,10], global;* right justify t
rscr ← test.parity;
cnt ← 7s;* IN [0..7]
iAddFGPL:
skpif[r even], rscr2 ← (PD←rscr2) rsh 1;* skpif current rscr2 even, then rshift 1
rscr ← (rscr) # (test.Parity);
noop;
loopUntil[CNT=0&-1, iAddFGPL];
*
t ← t OR (rscr);* turn this off until the problem w/ FGparity gets fixed -- then remove all calls to iAddFGParity!
return;
itGetPcXSH: subroutine;* ←PcX
pushReturn[];
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
t ← not(PcX’);
noop;
returnP[];




itIfuJumpSH: subroutine;* IfuJump[0]
pushReturn[];
call[itiSetIFUJret];
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
ifuJump[0];
itIfuJErr:
error;

itIfuJRet:
returnP[];

itiSetIFUJret: subroutine;* initialize KLINK so that afterDispatch will
pushReturn[];* return control to itIfuJRet.
call[itiJret2];
t ← link;
klink ← t;
returnP[];
itiJret2: subroutine;
coreturn;
branch[itIfuJRet];

itMakeFDAckSH: subroutine;* MakeF←D, MemAck, SH
pushReturn[];
setCtemp[test.Sh, test.memAck, test.makeFD];
call[iAddFGParity], t ← cTemp;
IFUTest ← t;
ifuTick;
noop;
noop;
returnP[];
itMosFhSh:* set the current instruction set
pushReturnAndT[];
call[iAddFGParity], t ← test.Fh;
IFUTest ← t;
ifuTick;
B←(stack);
B←(stack);
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
B←(stack);
B←(stack);
pReturnP[];

itMakeFDSH: subroutine;* MakeF←D, SH
pushReturn[];
setCtemp[test.Sh, test.makeFD];
call[iAddFGParity], t ← cTemp;
IFUTest ← t;
ifuTick;
noop;
noop;
returnP[];

itMemAckFH: subroutine;* MemAck, FH
pushReturn[];
setCtemp[test.Fh, test.memAck];
call[iAddFGParity], t ← cTemp;
IFUTest ← t;
ifuTick;
noop;
noop;
returnP[];
itMemAckShFh: subroutine;* MemAck, FH, SH
pushReturn[];
call[itMemAckSH];
call[itMemAckFH];
returnP[];
itMemAckSH: subroutine;* MemAck, SH
pushReturn[];
setCtemp[test.Sh, test.memAck];
call[iAddFGParity], t ← cTemp;
IFUTest ← t;
ifuTick;
noop;
noop;
returnP[];

itNewPcFH: subroutine;* PcF←, FH
* enter w/ t = value for new pc
pushReturnAndT[];* keep new pc value in rscr
call[iAddFGParity], t ← test.Fh;
IFUTest ← t;* iAddFGParity returned FG value in T
ifuTick;
PcF ← stack;
PcF ← stack;
pReturnP[];
itNewPcFhSh: subroutine;* PcF←, FH, SH
* enter w/ t = new pcF value
pushReturnAndT[];
call[itNewPcFH], t←stack;
call[itNewPcSH], t←stack;
pReturnP[];
itNewPcSH: subroutine;* PcF←, SH
* enter w/ t = value for new pc
pushReturnAndT[];* keep new pc value in rscr
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;* iAddFGParity returned FG value in T
ifuTick;
PcF ← stack;
PcF ← stack;
pReturnP[];

itNextDataSH:
subroutine;* ←NexData, SH
pushReturn[];
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
t ← ID;
noop;
returnP[];

itNoopFH: subroutine;* tick, FH, BmuxRM ← stack (originally from t)
pushReturnAndT[];
call[iAddFGParity], t ← test.Fh;
IFUTest ← t;
ifuTick;
B←stack;
B←stack;
pReturnP[];
itNoopFhSh: subroutine;* tick, FH, SH, BmuxRM ← t
pushReturnAndT[];
call[itNoopFH], t←stack;
call[itNoopSH], t←stack;
pReturnP[];
itNoopSH: subroutine;* tick, SH, Bmux ← t
pushReturnAndT[];
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
B←stack;
B←stack;
pReturnP[];

itResetFH: subroutine;* IfuReset, FH
pushReturn[];
call[iAddFGParity], t ← test.Fh;
IFUTest ← t;
ifuTick;
ifuReset;
ifuReset;
returnP[];
itResetSH: subroutine;* IfuReset, SH
pushReturn[];
call[iAddFGParity], t ← test.Sh;
IFUTest ← t;
ifuTick;
ifuReset;
ifuReset;
returnP[];

itSetFGFDSH: subroutine;* FG[0:7]←t, MakeF←D, SH
pushReturnAndT[];
rscr ← lsh[t, 10];* left justify the byte in rscr
setCtemp[test.Sh, test.makeFD];
call[iAddFGParity], t ← (rscr) OR (cTemp);
IFUTest ← t;
ifuTick;
noop;
noop;
pReturnP[];

itSetFGFH: subroutine;* FG[0:7]←t, FH
pushReturnAndT[];
rscr ← lsh[t, 10];* left justify the byte in rscr
call[iAddFGParity], t ← (rscr) or (test.Fh);
IFUTest ← t;
ifuTick;
noop;
noop;
pReturnP[];
itSetFGSH: subroutine;* FG[0:7]←t, SH
pushReturnAndT[];
rscr ← lsh[t, 10];* left justify the byte in rscr
call[iAddFGParity], t ← (rscr) or (test.Sh);
IFUTest ← t;
ifuTick;
noop;
noop;
pReturnP[];


itStep: subroutine;* TEST ← t
* enter w/ T= value for Test register
pushReturnAndT[];
call[iAddFGParity];
IFUTest ← t;
ifuTick;
noop;
noop;
pReturnP[];
* June 18, 1981 10:00 AM
%
Simulation subroutines, originally from ifu2.mc
%


itTick: subroutine;
pushReturn[];
call[incClock];
call[iAddFGParity], t ← FGbits;
ifuTest ← t;
ifutick;
b ← BmuxRM;
B ← BmuxRM;
returnP[];

itData: subroutine;* itData, itJumpData, and itJump should
pushReturn[];* never be called when test.Fh
call[incClock];
call[iAddFGParity], t ← FGbits;
t and (test.myFh);* we shouldn’t be called during test.Fh
skpif[ALU#0];* test.myFh (a "one bit") disables Fh
error;
ifuTest ← t;
ifutick;
b ← BmuxRM, t ← ID;
noop;
returnP[];

itJumpData: subroutine;
pushReturn[];
call[incClock];
call[iAddFGParity], t ← FGBits;
t and (test.myFh);* we shouldn’t be called during test.Fh
skpif[ALU#0];* test.myFh (a "one bit") disables Fh
error;
ifuTest ← t;
ifutick;
IfuJump[0], B ← BmuxRM, T ← ID;
noop;
iAnyIJumpRet:
returnP[];

itJump: subroutine;
pushReturn[];
call[incClock];
call[iAddFGParity], t ← FGbits;
t and (test.myFh);* we shouldn’t be called during test.Fh
skpif[ALU#0];* test.myFh (a "one bit") disables Fh
error;
ifuTest ← t;
ifutick;
IfuJump[0], B ← BmuxRM;
noop;
returnP[];

itNewPc:
subroutine;
pushReturn[];
call[incClock];
call[iAddFGParity], t ← FGbits;
ifuTest ← t;
ifutick;
PcF ← BmuxRM;
PcF ← BmuxRM;
returnP[];
itReset: subroutine;
pushReturn[];
call[incClock];
call[iAddFGParity], t ← FGbits;
ifuTest ← t;
ifutick;
IfuReset, B ← BmuxRM;
IfuReset, B ← BmuxRM;
returnP[];