Intel 9800758-02 manual RIGHT$,7-1O

Page 114

Index

SAVE, 1-4,6-22 SGN,7-11 SIN,7-11

single-precision floating-point constants, 2-7

SPACE$,7-11 SPC, 7-12 SQR,7-12 statements,

CLOSE, 5-3, 6-2 DATA,6-3 DEFDBL, 2-5,6-4 DEFFN,6-3 DEFINT, 2-5, 6-4 DEFSNG, 2-5,6-4 DEFSTR,6-4 DEFUSR, E-2, 6-4 DIM, 2-9, 6-5 ELSE,6-9 END,6-6 FIELD, 5-4, 6-7

FOR-NEXT-STEP, 6-7 GET, 5-6, 6-8 GOSUB,6-8

GOTO, 6-9 IF-THEN-ELSE,6-9 INPUT, 5-2, 6-9 LET,6-1O

LINE INPUT, 5-2,6-10 LSET, 5-7, 6-11 NEXT, 6-13

ON ERROR, 4-2, 6-13 ON ...GOSUB, 6-14 ON ... GOTO, 6-14 OPEN, 5-1, 6-14 OPTION BASE, 6-15 OUT,6-15 POKE,6-15 PRINT, 5-2, 6-16 PRINT USING, 6-16 PUT, 5-7, 6-1S READ,6-19 REM,6-20 RESTORE, 6-20 RESUME, 4-4, 6-21 RETURN, 6-21 RSET, 5-7,6-11 STEP, 6-7

STOP, 6-22

SWAP, 6-23

WAIT,6-24 STEP, 6-7 STOP, 6-22 string, 2-8

arrays, 2-10 constants, 2-8 data, 2-8 functions,

ASC,7-1

CHR$, 2-9, 7-2 FRE,7-5 HEX$, 2-9, 7-6 INSTR,7-7 LEFT$,7-7 LEN,7-8 MID$,7-9

BASIC-SO

OCT$, 2-9, 7-9

RIGHT$,7-1O

SPACE$, 7-11

STRING$,7-12 STR$,7-13 VAL, 7-14

operators, 2-12 variables, 2-S

STRING$,7-12

string to numeric conversion, 5...fi CVD, 5-7, 7-3

CVI, 5-7, 7-3

CVS, 5-7, 7-3 subroutines,

BASIC, GOSUB,6-8

ON ... GOSUB,6-14 RETURN, 6-21

non-BASIC, calling, E-l DEFUSR, E-2, 6-4 preparing, E-l USR, E-3, 7-13 VARPTR, E-2, 7-14

SWAP, 6-23

TAB,7-13

TAN,7-13

THEN,6-9 trace facility, 4-3 TROFF, 4-3, 6-23 TRON, 4-3, 6-23

underflow error message, 4-1, A-Iuser-defined,

functions, DEFFN,6-3

subroutines, DEFUSR, E-2, 6-4 USR, E-3, 7-13 VARPTR, E-2, 7-14

USR, E-3, 7-13

VAL, 2-9, 7-14 variables, 2-7

block assignment statements, 2-8 DEFDBL, 2-5, 6-4 DEFINT, 2-5, 6-4 DEFSNG, 2-5, 6-4 DEFSTR,6-4

numeric, 2-7 string, 2-8

type conversion functions, 2-8 CDBL, 2-9, 7-2

CINT,2-9,7-2

CSNG, 2-9, 7-3 type suffixes, 2-6

#double-precision floating-point, 2-6 070 integer, 2-6

! single-precision floating-point, 2-6 $ string, 2-8

VARPTR, E-2, 7-14

WAIT,6-24

WIDTH,6-24

Index-4

Image 114
Contents BASIC-SO Reference Manual A108/0979/7500 FL Preface Page Contents Illustrations Chapter Introduction to BASIC-80 Invoking BASIC-80Basic filename MEMTOPaddress ExamplesIntroduction to BASIC-80 FilenameChanging File Attributes Listing the Directory of a DiskRenaming a File Deleting a FileYou can now run, list, or edit the program Save LP ,ACommands StatementsBASIC-80 Commands Contd BASIC-80 StatementsBASIC-80 Statements Contd BASIC-80 FunctionsBASIC-80 Functions Contd Representing Data FunctionsDecimal Integer Constants ConstantsInteger Constants Hexadecimal Integer ConstantsOctal Integer Constants Single-Precision Floating-Point ConstantsDouble-Precision Floating-Point Constants This is a string constant String ConstantsString Variables $ = Enter next data stringL4! = Csng l4 YI,1String Arrays Arithmetic Operators BASIC-SO Operators in Order of Precedence ContdNumeric Expressions Logical OperatorsString Operator String ExpressionsEntering and Editing Programs 30 A=8*52 30 A=8*37 30 A=8*5230 A=8 30 A--=8xx*522537 Control-R a = 8*37Integer D SubcommandCommand 3D press 3, then D results If AB thenIf AB then 120 Else Null SET Syntax of the X subcommand is At this point, the other editing subcommands may be usedMove the cursor to PRINT. Enter 2C RE L Print Undefined SET The E subcommand is enteredInteger C character character Print Undefined SET. Enter a LBASIC-80 Error Messages Syntax Error MessagesOverflow, Underflow, and Divide-by-Zero Error Trapping Trace Facility Restarting Program Execution Error SimulationError Handling If line 40 is replaced withOpening a Sequential File Open 1,#1,F1DATESReading from a Sequential File Refer to for further details of Print UsingWriting to a Sequential File If executed four times, it would read all eight valuesClosing a Sequential File Value of R$ would beBuffers Defining a Random 1/0 Field-FIELDField #3, 20 AS N$ Disk File Input/Output Field #3, 20 AS N$, 9 AS SS$Any of the parameters can be variables Opening and Closing a Random Disk FileReading from a Random 1/0 File To read the next recordSingle-precision value Writing to a Random 1/0 FileInteger Double-precision valueMKI$ Auto first lineJ, increment Attrib Fdrive numberfilename, W1Attrib Fdrive numberfilename, WO Clear expression,addressCommands and Statements CloseDEF FNX Rules for function name are the same as for variable nameDefsng Defdbl Defstr Defint DIM DeleteEdit ErrorDIR ENDField Error expressionExit FOR-NEXT-STEPFor variable=expression to expression Step expression GETGosub GET I file number ,record numberIF-THEN-ELSE InputGoto Line Input KillLET ListLSET, Rset LoadMerge NEWNext 9 16On ... Gosub On ... GotoOpen Option Base OUTPoke Print Using PrintString Fields Numeric fields If X$=SEVEN and Y$=EIGHT, the results of line 40 would bePrun PUTRandomize ReadREM Resume ReturnLine number RUN filename SaveRUN line numberlstring expression ,F 60 ENDTRON, Troff ? 5,8,2Wait WidthABS ATNCHR$ CintFunctions 10 A# = 1.00/3.00 CsngCVI CVS AO/o =Dskf EOFFIX Ok·Hexs INPInputs INT InstrLEFT$ LOF LENLOC LOGMID$ MKI$ MKS$ MKD$OCT$ POS integer RightsPeek expression RIGHT$ string,integerSpaces SGNSIN 10 a =1If A$ = 2 then Print Correct Else Goto SPCSPC integer SQRexpressionSTR$ expression TAB expressionTAN expression Here is an example of how the USRn statement is used 60 AO/o =Appendix a BASIC-SO Error Codes Table A-I. BASIC-80 Error CodesTable A-I. BASIC-SO Error Codes Contd Appendix B BASIC-SO Reserved Words Page To tab across the line To halt program execution and return to commandLevel To resume program execution after it is stopped byPage Table D-l. Ascii Code List Appendix D Ascii CodesTable D-2. Ascii Code Definition BELAppendixe Calling Subroutines Figure B-1. Internal Representation of Numbers and Strings Some Real Examples RESULT=USR%1VARPTRA, VARPTRB, VARPTRC» PRINTA+B+C= ResultFigure E-2 /8085 Assembly Language Program Figure E-3. PL/M-80 Program Appendix F RMX/SO BASIC-SO Initializing the Predefined RMX/SO BASIC-SO Configuration ISIS-II BASIC-SOTable F-l. Sample Configuration Jumper Wiring OOOOH-OFFFHBASIC-80 Object Files Generating Boot-Loaded and PROM-Based VersionsBASIC-80 Source Files BASIC-80 Executable FilesGenerating a Boot-Loaded RMX/80 BASIC-80 Setting baud rates, refer to the RMX/SO Users Guide That are not boot loadedThis option is used to allocate memory. It is 1 if the boot This option enables your user-written I/O drivers if youISBC 80/20-4 Generating a PROM-Based RMX/80 BASIC-80 Prom F1 RMX820.L1BSTART, & FOBASCM.OBJ,& FORMXBAS.LlB F1 DFSDIR. L1BDIRECTORY ,RENAM E,& F1 MTI810.L1B Configuration Requirements Configuring DFS on an iSBC 80/10Adding BASIC-SO to an Existing RMX/SO Configuration ISBC SO/10 System ClockPublic Variables Adding User-Written I/O Drivers to RMX/SO BASIC-SO Open 0,#1, L1LlSTFigure F-S. Sample User-Written 1/0 Driver Routine Altering BASIC-80 Workspace Burning a BASIC-80 Program Into PromBaprom F1HEATER.BAS Page Index Ase BASIC-80 RIGHT$,7-1O Request for Readerscomments 111111