******************************************************************************** * Name: David DiPaola (aka 650603) * Project: Lab 3 Problem 3 ******************************************************************************** TWO EQU 2 ;give 2 a constant nFIVE EQU -5 ;give -5 a constant SIX EQU 6 ;give 6 a constant X EQU 2 ;give 2 a constant ORG $2000 ;start the program at $2000 *Do the x^2 ldaa #X ;load x into register a ldab #X ;load x into register b MUL ;multiply a and b, stores in d std $3000 ;store the result at $3000 *Multiply the previous result by two ldaa $3001 ;load the lower byte of the previous result ldab #2 ;load the multiple MUL ;multiply a and b, stores in d std $3000 ;store the result at $3000 *Do the (-5)*X ldaa #nFIVE ;load negative five into a ldab #X ;load X into b MUL ;multiply a and b, stores in d std $3002 ;store the result at $3002 *Do the addition of the previous two results and six ldaa $3003 ;load the lower byte of the previous result adda $3001 ;add the lower byte from previous data into a adda #SIX ;add six to the running total staa $3003 ;store the result in $3003 SWI ;done