REM Assemble the cube root function PROCassemble : REM Prompt for one number, so you can see that the REM function is working REPEAT INPUT"Find cube root of ";A% UNTIL A%>-1 REM The USR function takes the *address* of the machine code as its REM parameter, not the parameter to pass to it! REM This is subtly different from FNcube_root... result%=USR(cube_root) IF (result%*result%*result%)=A% THEN PRINT"Cube root is ";result%;" exactly" ELSE PRINT"Cube root is between ";result%-1;" and ";result% ENDIF : REM Then do our speed test PRINT'"Speed test... find cubes of all numbers from 1-10000" : TIME=0:FOR A%=1 TO 10000 v%=FNcube_root(A%) NEXT:PRINT TIME/100;" seconds in BASIC" : TIME=0:FOR A%=1 TO 10000 v%=USR(cube_root) NEXT:PRINT TIME/100;" seconds in ARM code" : END : DEF FNcube_root(n%) check%=1:result%=0 WHILE (result%