***THE PATCH MACRO "E" DOES NOT USE "ILC" AS THE TARGET MEMORY SO THE DEFAULT
***OF BA=.+1 FOR "SETFC" AND "SETFB" DON'T WORK AND THE USE OF .+1, ETC. IS
***VERBOTEN DURING AN "E".


*! MAXC1 ONLY
*BYPASS HW PROBLEM OF TESTING SIGN Y AFTER LOADING Y FROM SLOW SOURCE
E[0,SHFT]; YSHIFT←P, P←Q←LAC, GOTO[RETN];
E[0,FSC]; YSHIFT←P, CLEARF[G], CALL[RETN];
E[0,ASHC]; YSHIFT←P, Q←LAC, INCAC, CALL[RETN];
E[0,CSHFT]; YSHIFT←P, INCAC, Q←LAC, CALL[RETN];
E[1,FAD]; Y←P-Q, CALL[RETN];
E[1,FSB]; GOTO[ADD[1,IP[FAD]]];
E[1,NORMZ1]; RPGRT3←P←Q←A0, Y←-1S, GOTO[RETN];

*BYPASS WRESTART STOP LOGIC PROBLEM


*BYPASS WREF STOP LOGIC PROBLEM
E[0,WTOP1]; REFADR←P, Q←MDR, DGOTO[WQTOP0];
	WREF, GOTO[QTOLX,G=1];



*BYPASS STOP LOGIC AFTER 1 CYCLE PROBLEM
E[0,RABS]; GOTO[ILC];
TARGET[ILC]; Q←MDR, GOTO[QTOAC];

E[23,ALEVX]; READ←PSWITCH, GOTO[ILC];
TARGET[ILC]; GOTO[ASWIT];

E[0,RESIO]; GOTO[ILC];
TARGET[ILC]; P←DLSOD←MDR, GOTO[IORESET];


*BOTH QUICK READ AND WRESTART PROBLEMS
*WRITE← WON'T WAIT FOR PREVIOUS READ PROBLEM
E[0,WLITES]; MDR, SETSF[G], GOTO[ILC];
TARGET[ILC]; WRITE←1S, GOTO[QTOMCHK];
*!


*SOFTWARE FIXES

%THE PATCH BELOW FIXES THE INCOMPATIBILITY THAT THE PDP-10 ROUNDS
FDVR BEFORE NORMALIZING.  WHEN THE ARGUMENTS ARE UNNORMALIZED THIS
PRODUCES A DIFFERENT RESULT THAN ON MAXC.  THE MAXC RESULT IS MORE
ACCURATE.
E[1,FDVR]; RPGRT3←P-Q, X←33S, DGOTO[ILC];
TARGET[ILC]; P←AQ;
	GOTO[.+2,ALU>=0];
	P←(P-1) ARSHC 1, GOTO[.+2];
	P←(P+1) ARSHC 1;
	LTEMP←P, P←RPGRT3, Q←200S, GOTO[ADD[1,IP[FDVR1]]];
DI[174,RARG,FDVR,NORMA];
DI[175,ESWAP,FDVR,NORMA];
DI[176,RARG,FDVR,NORMM];
DI[177,RARG,FDVR,NORMB];
%

IFG[IP[SLC],326,ER[SM-CONSTANT-OVERFLOW]];
IFG[IP[VSLC],377,ER[SM-VARIABLE-OVERFLOW]]; *377 CLOBBERED BY MIDAS?
IFG[IP[ILC],LASTOK,ER[IM-OVERFLOW]];
SET[NILEFT,ADD[NOT[IP[ILC]],LASTOK,1]];
SET[SLCLEFT,ADD[327,NOT[IP[SLC]]]];
SET[VSLCLEFT,ADD[401,NOT[IP[VSLC]]]];
REPEAT[NILEFT,ILC[BRKP[1]]]; *FILL IM FOR CHECKER
REPEAT[SLCLEFT,SLC[0V]];
REPEAT[VSLCLEFT,VSLC[0V]];

SM[XSLC,IP[CSUMD]];
XSLC[2763 2572 1236V];
XSLC[0332 2552 1661V];
XSLC[4772 2663 0202V];
XSLC[4143 0000 0000V];

ER[Number.of.unused.IM.locations.=.,0,NILEFT];
ER[Number.of.unused.SLC.locations.=.,0,SLCLEFT];
ER[Number.of.unused.VSLC.locations.=,0,VSLCLEFT];