BASIC USR Function - fvdhoef/aquarius-plus GitHub Wiki

USR

TYPE: BASIC Floating-Point Function

FORMAT: USR(numeric)

Action:

The USR function jumps to a User callable machine language SubRoutine which has its starting address pointed to by the contents of memory locations 14340-14341. The starting address is established before calling the USR function by using POKE statements to set up locations 14340-14341. Unless POKE statements are used, locations 14340-14341 will give you an ?FC error message.

The value of the numeric argument is stored in the floating-point accumulator starting at location 14564, for access by the Assembler code, and the result of the USR function is the value which ends up there when the subroutine returns to BASIC.

EXAMPLES of USR Function:

10 B=T*SIN(Y)
20 C=USR(B/2)
30 D=USR(B/3)