By Gilbert Held , 1807M1982 WILEY QUICK REFERENCE GUIDES
Total Page:16
File Type:pdf, Size:1020Kb
by Gilbert Held , l:i '\f..AR I 1807m1982 WILEY QUICK REFERENCE GUIDES 2.95 &HL1<;H\~ REFERENCE GUIDE NOTATIONS AND FORMAT CONVENTIONS A standard scheme for presenting the general format of BASIC language state ments is employed in this reference guide. Th e capitalization, punctuation and other conventions are listed below: [ ] Brackets indicate that the en actual value or wording required. closed items are optional. See Generic Term s and Brackets do not appear in the Abbreviations. actual statements. Line number A line number is im } Braces indicate that a choice of plied for all BASIC language one of the enclosed items is to be statements. made. Braces do not appear in Punctuation All punctuation the actual statements. characters, including commas, •.• Ellipses indicate that the preced semicolons, colons, quotation ing item may be repeated. marks and parentheses, must Ellipses do not appear in the ac appear as indicated. tual statements. UPPER CASE Upper case letters Italics Italics indicate generic terms. and words must appear exactly The programmer must supply the as indicated. APPLE BASIC VERSIONS Applesoft-Comprehensive BASIC tions. Line numbers must be be which permits numeric values tween O and 32767. with fractions. Line numbers VIDEO PROMPT CHARACTERS must be between O and 63999. Character Language Integer BASIC-A version of BASIC wh ich limits calculated va lues to * Monitor a range of 32767 to - 32767, > Integer BASIC and does not permit decimal frac- Applesoft GENERIC TERMS AND ABREVIATIONS Arg-Argument. memadr- Th e memory address Bn-A byte number. referenced by a numeric expres col-Low resolution graphics column sion, variable or constant. number. O s numeric expression - 65535 10 s range s 65535 10. s 39. memloc-the memory location colh-High resolution graphics specified by an integer constant. column number. O s numeric ex 010 ~ range s 65535,o pression s 279. msg- The message denoted by const-Any numeric or string quotes which forms a string. constant. nvar-Numeric variable. Dn-A disk drive number. Must be row-Low resolution graphics row specified as D,0 or D 1. number. 0 s numeric expressions 47. expr-Any valid Apple II expression. rowh-High resolution ·graphics expr$-Any valid Apple II string row number. O s numeric ex- constant, variable or expression. pression s 191 exprnm-Any numeric constant, Rn-Specified field of a file. variable or expression. slot-predefined areas into filenam-A disk file name. which circuit boards plug. format-Format of BASIC language Sn-Slot number for input or output. statement common to both Apple- Osns7 soft and Integer BASIC. sub-Subscript. formata5 -Applesoft BASIC format of BASIC language statement. var-Numeric or string variable in format18-Jnteger BASIC format of Integer BASIC. Numeric, integer BASIC language statement. or string variable in Applesoft. length-Integer ranging from Ji varnm-A numeric variable name. through 32767 decimal. var(subJ-Any subscripted numeric lin-A BASIC program line number. variable in Integer BASIC. Any line,--The ith line number in a subscripted integer, numeric or BASIC program. string variable in Applesoft. Ln-Length in bytes. Integer ranging Vn-A disk volume number. in value from O to 32767 decimal. O s n s 255 APPLE II ® is a registered trademark of Apple Computer, Inc. VARIABLE NAMING CONVENTIONS Applesoft format F {SL} where: Integer BASIC format F{SL} F irst character must be a letter. where: Second character is optional and may First character must be a letter. be a letter or digit. Second character to last character Last character denotes variable type: may be letter(s) or digit(s). $for string variable, % for in Last character mu st be a$ for string teger va riable, otherwise real va riable . variable. Name length may be 1 to 100 Name length must be 1, 2 or 3 characters. characters. ARITHMETIC OPERATORS OPERATION INTEGER BASIC APPLESOFT ARITHMETIC Exponentation /\ /\ Unary Minus Multiplication * * Division Division Remainder MOD Not Available Addition + + Subtraction RELATIONAL Equal Not Equal # <>or>< Less than < < Greater than > > Less than or equal < = < =or= < Greater than or equal > = >= or= > BOOLEAN Logical complement NOT NOT Logical AND AND AND Logical OR OR OR SYSTEM COMMANDS AUTO-Integer BASIC command program lines. that sets the automatic line format: DEL line 1, line2 numbering mode. FP-Puts the Apple 11 into Applesoft. format 18: AUTO line [. increment] format: FP[.Dn] [.Sn] [.Vn] CLR-lnteger BASIC command that assigns zero values to all INT-Puts the Apple II into Integer BASIC. variables and array elements. format: INT format18 : CLR LIST-Displays all or a specified portion CON-Integer BASIC command of the program currently in memory. that causes a program to resume format: LIST line 1 L line2] execution at the next instruction line 1 [{-;- }] } following a halt. { formatAs: LIST [linei]{ -;- } /ine2 format18: CON CONT-Applesoft command that MAN-Ends the automatic line causes a program to resume numbering mode in Integer BASIC. execution at the next instruction format : MAN following a halt. 18 MON-Permits the display of disk formatAs: CONT commands and/or data traffic on DEL-Eliminates the specified the video monitor. format: MON [CJ [,I] [,OJ disk commands and/or data flow where: C is specified to display initiated by MON command. disk commands format: NOMON I is specified to display AUN-Executes the current pro data flow from disk to gram in memory. If a line number App le II is specified, execution com 0 is specified to display mences at that number, other data flow from Apple II wise execution begins at the to the disk lowest numbered line in the NEW-De,letes the current program program. and all variables from memory in format: RUN [line] the Apple II. SAVE-Saves the program currently format: NEW in memory on cassette or on disk. NOMON-Ends the video display of See Input/Output control for formats. BASIC LANGUAGE STATEMENTS BRANCHING CALL-Results in a branch to format 18: IF expr THEN statement a machine language subroutine IF expr THEN [GOTO] line at a specified memory location. ON·GOSUB-Causes a conditional format: CALL memadr Applesoft subroutine call. GOSUB-Results in a branch to Branch depends upon the com the indicated line number. A puted or current value of the ex return statement causes a pression. branch back to the instruction formatAs: ON exprnm GOSUB following the GOSUB. line[, line . ] format: GOSUB line ON-GOTO-Causes a conditional GOTO-Causes an unconditional Applesoft branch based upon the branch to the indicated line current or computed value of the number or the numeric expres expression. sion in Integer BASIC. formatAs: ON exprnm GOTO line format: GOTO line [,line ] POP-Causes the most recently ex format: 18 : GOTO exprnm ecuted GOSUB to be changed to IF-THEN-Causes a branch a GOTO by removing the return or the execution of a statement location for the last GOSUB to occur if the indicated expres statement executed. sion is true. format: POP format: IF expr THEN statement [:statement ] RETURN-Results in a program branch to the statement im mediately following the most THEN IF expr GOTO fline recently executed GOSUB lTHEN GOTO statement. format: RETURN ERROR DETEAMl~ATION AND CONTROL DSP-lnteger BASIC statement ONEAA GOTO-Applesoft state that displays the changing ment that causes a branch to va lues of a predefined variable the line number indicated if an during program execution. error occurs in the program. format18 : DSP var formatAs: ON ERR GOTO line NO DSP-lnteger BASIC statement AESUME-Applesoft statement that cancels the display mode that causes the program to for a predefined variable. resume at the beginning of an instruction in which an error format : NO DSP var 18 previously occurred. NO TRACE-Turns off the program execution TRACE initiated by a formatAs: RESUME TRACE statement. TRACE-Displays the line number format: NO TRACE of each statement executed. format: TRACE MEMORY REFERENCE CLEAA-Applesoft statement that assigns a null value to all strings. initializes all numeric variables formatAs: CLEAR and array elements to zero and HIMEM-Establishes the highest LOMEM-Establishes the lowest location in RAM memory available location in RAM memory available for use by the BASIC program. for use by the BASIC program. format: HIMEM: exprnm format: LOMEM: exprnm PROCESSING STATEMENTS DATA-Applesoft statement th at LET-Assigns a value to the creates a list of values to be specified variable. assigned to variables through the format: [LET] var = expr use of a READ statement. NEXT-Terminates the loop in format: DATA canst[, canst . .. ] itiated by a FOR statement DEF FN-Applesoft statement that format: NEXT varnm [, varnm . permits special purpose functions to be defined. READ-Applesoft statement that assigns values from DATA state format : DEF FNnvar (arg) = ments to variables. exprnm formatAs: READ var[. var . .. ] DIM-Reserves space in main memory for an array or string . REM-Nonexecutable statement that permits remarks to be placed formatAs: DIM var(sub[, sub ... ]) in the program. [,var(sub[,sub .]) . ] format: REM remark format18 : DIM var(sub) [, var(sub) RESTORE-Applesoft statement l that resets the DATA list pointer END-Causes the program to to the beginning of the list. terminate. formatAs: RESTORE format: END STOP-Applesoft statement that cau ses FOR-Initiates a loop that repeats the program to halt execution. execution of all instructions bounded by the NEXT statement formatAs: STOP until the automatically in WAIT-Applesoft statement that halt s cremented variable attains the a program until a specified memory value exprnm2. location attains a defined value. format: FOR varnm = exprnm1, formatAs: WAIT memadr, exprnm, TO exprnm2 [STEP exprnm3] [,exprnm] INPUT/OUTPUT CONTROL GENERAL GET-Applesoft statement that control device. receives one character from the format: POL (expmm) keyboard without displaying the character.