1*29586Ssam /* Aadwc.c 1.1 86/07/20 */ 2*29586Ssam 3*29586Ssam #include "../tahoealign/align.h" 4*29586Ssam adwc(infop) process_info *infop; 5*29586Ssam /* 6*29586Ssam /* Add with carry. 7*29586Ssam /* Note : the play with 'tmp' just before the 'asm' line makes 8*29586Ssam /* sure that when the adwc opcode is executed, the current 9*29586Ssam /* carry in psl is the same as the 'offending' process'. 10*29586Ssam /* Don't change unless you know exactly what you're doing. 11*29586Ssam /* 12*29586Ssam /*****************************/ 13*29586Ssam { 14*29586Ssam register long Register_12; /* Has to be first reg ! */ 15*29586Ssam register long Register_11; 16*29586Ssam register long Register_10; 17*29586Ssam register long tmp; 18*29586Ssam 19*29586Ssam Register_12 = operand(infop,0)->data; 20*29586Ssam Register_11 = operand(infop,1)->data; 21*29586Ssam if (carry) /* If process' carry set */ 22*29586Ssam tmp = -1; 23*29586Ssam else tmp = 0; 24*29586Ssam tmp++; /* 0 => carry set. 1 => carry clear */ 25*29586Ssam 26*29586Ssam Register_10=psl; 27*29586Ssam Set_psl(r10); /* restore the user psl */ 28*29586Ssam asm(" adwc r11,r12"); 29*29586Ssam asm(" movpsl r11"); 30*29586Ssam New_cc (Register_11); 31*29586Ssam 32*29586Ssam write_back(infop, Register_12, operand(infop,1) ); 33*29586Ssam } 34