Commands and Statements

BASIC-SO

DEFSNG

DEFDBL

DEFSTR

DEFINT

The DEFSNO, DEFDBL, DEFSTR, and DEFINT statements are used to specify that a given block of letters will designate a specific data type when used as the first letter of variable names. The DEFSNO, DEFDBL, DEFSTR, and DEFINT statements specify single precision floating point, double precision floating point, string, and integer representation, respectively. Blocks of letters are specified according to the syntactic format given below:

DEFXXX m [-n][,m[-n]] ...

in which m represents any letter, A through Z, and n represents any letter B through Z. These two letters represent the boundaries of a block of letters between m and n. If n is not used, only variables beginning with letter m are specified. The n argument must follow m in alphabetic sequence; in other words, blocks may be defined as D to L, or A to 0, but not as P to A or Z to M.

10DEFSTR S

20DEFDBL D

30DEFINT I-N

DEFUSRn

The DEFUSRn statement is used to specify the starting address of an SOSO/SOS5 assembly-language, PL/M-SO, or Fortran-SO subroutine so they may be called by the USR function. The argument n may be an integer from 0 to 24; if no argument is given, 0 is assumed. Two examples of DEFUSRn statements are given below:

DEFUSR = OFOOOH

DEFUSR7 = 1%

Because of the way BASIC-SO represents numbers internally, 32767 is the largest value for an integer expression. The following code can be used to specify higher decimal values in a DEFUSRn statement.

10INPUT "ENTER ENTRY ADDRESS IN DECIMAL"; A

20IF A> 32767 THEN A = A-65536

30DEFUSR11 = A

The program below shows how DEFUSR defines a subroutine. Refer to Appendix E for further details of using DEFUSR.

10 REM This program asks for three

20REM Integers, passes them to USR1, and

30REM Returns the result.

40DEFINT A-Z

50DEFUSR 1 =OEOOOH

60PRINT "Enter three numbers:"

70 INPUT A, B, C

80 PRINT "A =";A; "B =";B; "C =";C 90 RESULT = USRo/01 (A, B, C)

100PRINT "A+ B+C+ =" RESULT

110END

6-4

Page 44
Image 44
Intel 9800758-02 manual Defsng Defdbl Defstr Defint