.TITLE Example ; This program will calculate the value of the ; function F(X) = 2*X + 512*X*X for integer inputs ; Variable list: X: .LONG 15 ; Input is decimal 15 .ENTRY Function, 0 Begin: MULL3 #2, X, R2 ; R2 now has 2*X MULL3 X, X, R3 ; R3 now has X*X MULL2 #512, R3 ; R3 now has 512*X*X ADDL2 R2, R3 ; R3 has the result Done: $EXIT_S .END Function