1*45699Sbostic /* Aadwc.c 1.2 90/12/04 */ 229586Ssam 3*45699Sbostic #include "align.h" 429586Ssam adwc(infop) process_info *infop; 529586Ssam /* 629586Ssam /* Add with carry. 729586Ssam /* Note : the play with 'tmp' just before the 'asm' line makes 829586Ssam /* sure that when the adwc opcode is executed, the current 929586Ssam /* carry in psl is the same as the 'offending' process'. 1029586Ssam /* Don't change unless you know exactly what you're doing. 1129586Ssam /* 1229586Ssam /*****************************/ 1329586Ssam { 1429586Ssam register long Register_12; /* Has to be first reg ! */ 1529586Ssam register long Register_11; 1629586Ssam register long Register_10; 1729586Ssam register long tmp; 1829586Ssam 1929586Ssam Register_12 = operand(infop,0)->data; 2029586Ssam Register_11 = operand(infop,1)->data; 2129586Ssam if (carry) /* If process' carry set */ 2229586Ssam tmp = -1; 2329586Ssam else tmp = 0; 2429586Ssam tmp++; /* 0 => carry set. 1 => carry clear */ 2529586Ssam 2629586Ssam Register_10=psl; 2729586Ssam Set_psl(r10); /* restore the user psl */ 2829586Ssam asm(" adwc r11,r12"); 2929586Ssam asm(" movpsl r11"); 3029586Ssam New_cc (Register_11); 3129586Ssam 3229586Ssam write_back(infop, Register_12, operand(infop,1) ); 3329586Ssam } 34