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