.TITLE AVERAGE Version 6 ; Section 2.4, page 65 ; This program will calculate the average of ; three numbers: X, Y, and Z. The result will be ; saved in location Ave. X: .WORD 1560 ;Create storage for the Y: .WORD 1432 ;data Z: .WORD 2167 Ave: .BLKW 1 ;Save room for the answer .ENTRY Average, 0 Begin: ADDW3 X, Y, R5 ; R5 contains X + Y ADDW2 Z, R5 ; R5 contains X+Y+Z DIVW3 #3,R5,Ave ; Ave contains R5/3 $EXIT_S .END Average