//Accumulator Code
//Add the absolute values of every element in array DAT and 
//save the sum to SUM
//Declaration 
I 1 0			//Array Index
SUM 1			//Sum
N 1	9			//Nunber of elements in the array
TMP 1 0			//Temporary location 
PDAT 1 DAT		//PDAT is a pointer that contains address of DAT
DAT 9 10 20 30 -40 50 60 70 80 -90 	//THE DATA ARRAY
END
//Instructions
L1:	GET N 			
	SUB	I			
	BEQZ L3			//if (N-I)=0, done
	GETI PDAT		//Get an array element into ACC
	BGEZ L2 		//if positive, skip
	PUT TMP			//else, negate
	LI 0			
	SUB TMP			
L2:	ADD SUM			//add to sum
	PUT SUM			
	GET I			//increase index I by one
	ADDI 1
	PUT I
	GET PDAT		//increase array address by one
	ADDI 1			
	PUT PDAT
	GOTO L1			//next element
L3:	GET SUM			//print sum
	PRNT
	STOP			//stop
END
//Inputs
//None