.TITLE Example ; This program will calculate the value of the ; function F(X) = 2*X + 512*X*X for integer inputs ; Variable list: X: .BLKL 1 ; Reserve room for X .ENTRY Function, 0 Input , Long = X 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 Output , Long = X Output , Long = R3 $EXIT_S .END Function