//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			//Number 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
L3:	PUSH N 			
	PUSH I
	SUB			
	BEQZ L5			//if done (N-I)=0
	PUSHI PDAT		//Get an array element 
	PUSHI PDAT		//Get the array element again for testing if negative
	BGEZ L4 		//if positive, skip
	PUSH 0			//else, negate
	SWAP
	SUB			
L4:	PUSH SUM		//to sum
	ADD
	POP SUM
	PUSH I			//increase index I by one
	PUSH 1
	ADD
	POP I
	PUSH PDAT		//increase array address by one
	PUSH 1
	ADD			
	POP PDAT
	GOTO L3			//next element
L5:	PUSH SUM		//print sum
	PRNT
	STOP			//stop
END
