NSB8 BASIC interpreter for Z80 family USER MANUAL Via dell' Artigiano, 8/6 (Bologna) ITALY E-mail: grifo@grifo.it http://www.grifo.it http://www.grifo.com Tel. +39 051 892.052 (a.r.) FAX: +39 051 893.661 Rel. 17 April 2000 NSB8 Edizione 5.10 , GPC(R), grifo(R), are trade marks of grifo(R) ITALIAN TECHNOLOGY grifo (R) 40016 San Giorgio di Piano NSB8 BASIC interpreter for Z80 family NSB8 is a powerful software development tool which allows high-level programming in BASIC on all the grifo(R) boards based on Z80 microprocessor family. It includes a complete floating point management with 8 significant digits plus trigonometric and trascendental functions. The development environment is extremly friendly and achieves to reduce the development time, being anyway compliant to the operational feeling of all the BASICs. The great code performance and the rapidity of hardware intervents make the NSB8 an unreplaceable work instrument for all the applications. The NSB8 interpreter supports mathematic functions, control applications, data base management, interfacing to generic consoles, operating system calls and many other features designed to solve industrial automation problems. Via dell' Artigiano, 8/6 (Bologna) ITALY E-mail: grifo@grifo.it http://www.grifo.it http://www.grifo.com Tel. +39 051 892.052 (a.r.) FAX: +39 051 893.661 Rel. 17 April 2000 NSB8 Edizione 5.10 , GPC(R), grifo(R), are trade marks of grifo(R) ITALIAN TECHNOLOGY grifo (R) 40016 San Giorgio di Piano DOCUMENTATION COPYRIGHT BY grifo(R) , ALL RIGHTS RESERVED No part of this document may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, either electronic, mechanical, magnetic, optical, chemical, manual, or otherwise, without the prior written consent of grifo(R). IMPORTANT Although all the information contained herein have been carefully verified, grifo(R) assumes no responsability for errors that might appear in this document, or for damage to things or persons resulting from technical errors, omission and improper use of this manual and of the related software and hardware. grifo(R) reserves the right to change the contents and form of this document, as well as the features and specification of its products at any time, without prior notice, to obtain always the best product. For specific informations on the components mounted on the card, please refer to the Data Book of the builder or second sources. SYMBOLS DESCRIPTION In the manual could appear the following symbols: Attention: Generic danger Attention: High voltage Trade Marks , GPC(R), grifo(R) : are trade marks of grifo(R). Other Product and Company names listed, are trade marks of their respective companies. ITALIAN TECHNOLOGY grifo(R) GENERAL INDEX INTRODUCTION ........................................................................................................................ 1 VERSIONS .................................................................................................................................... 1 GENERAL FEATURES............................................................................................................... 2 NSB8 REQUIREMENTS ............................................................................................................ 3 RECEIVED MATERIAL ............................................................................................................ 3 NSB8 DISK ................................................................................................................................. 3 NSB8 USER MANAUL DISK .................................................................................................. 3 HOW TO START ......................................................................................................................... 4 COMMANDS ALOAD .......................................................................................................................................... 7 APPEND ........................................................................................................................................ 8 ASCSAVE ...................................................................................................................................... 9 AUTO ........................................................................................................................................... 10 BYE .............................................................................................................................................. 11 CAT .............................................................................................................................................. 12 CONT ........................................................................................................................................... 13 DEL .............................................................................................................................................. 14 LIST ............................................................................................................................................. 15 LOAD ........................................................................................................................................... 16 MEMSET .................................................................................................................................... 17 PSIZE ........................................................................................................................................... 18 REN .............................................................................................................................................. 19 RUN ............................................................................................................................................. 21 SAVE ............................................................................................................................................ 22 SCR .............................................................................................................................................. 23 STATEMENTS CHAIN ......................................................................................................................................... 24 CLOSE ......................................................................................................................................... 25 DATA ........................................................................................................................................... 26 DEF .............................................................................................................................................. 27 DIM .............................................................................................................................................. 28 END .............................................................................................................................................. 29 ERRSET ...................................................................................................................................... 30 EXIT ............................................................................................................................................ 31 FILL ............................................................................................................................................. 32 FNEND ........................................................................................................................................ 34 FOR .............................................................................................................................................. 35 GOSUB ........................................................................................................................................ 36 NSB8 Rel. 5.10 Page I grifo(R) ITALIAN TECHNOLOGY GOTO .......................................................................................................................................... 37 IF .................................................................................................................................................. 38 INPUT .......................................................................................................................................... 39 INPUT1 ........................................................................................................................................ 41 LET .............................................................................................................................................. 42 LINE ............................................................................................................................................ 43 NEXT ........................................................................................................................................... 44 ON ................................................................................................................................................ 45 OPEN ........................................................................................................................................... 46 OUT ............................................................................................................................................. 47 PRINT .......................................................................................................................................... 48 READ# ......................................................................................................................................... 50 READ ........................................................................................................................................... 51 REM ............................................................................................................................................. 52 RESTORE ................................................................................................................................... 53 RETURN ..................................................................................................................................... 54 RETURN ..................................................................................................................................... 55 STOP ............................................................................................................................................ 56 WRITE ........................................................................................................................................ 57 CONTROL-C, THE PANIC BUTTON .................................................................................... 59 MULTIPLE I/O DEVICES ........................................................................................................ 60 FUNCTIONS ............................................................................................................................... 61 BUILT IN FUNCTIONS ......................................................................................................... 61 ARGUMENTS ......................................................................................................................... 61 MATHEMATIC FUNCTIONS .............................................................................................. 62 STRING FUNCTIONS ........................................................................................................... 63 SPECIALIZED INPUT OUTPUT FUNCTIONS................................................................. 63 DISK FILES FUNCTIONS .................................................................................................... 65 MISCELLANEOUS FUNCTIONS ....................................................................................... 65 USER FUNCTIONS ................................................................................................................ 66 FUNCTION NAMES ........................................................................................................... 66 SINGLE LINE FUNCTIONS .............................................................................................. 66 PASSING VALUES TO USER FUNCTIONS .................................................................... 67 NUMERIC PARAMETERS ................................................................................................ 67 STRING PARAMETERS .................................................................................................... 67 MULTI LINE USER FUNCTIONS .................................................................................... 68 SOME FINAL NOTES ......................................................................................................... 68 USING NUMBERS .................................................................................................................... 70 CONSTANTS ........................................................................................................................... 70 VARIABLES ............................................................................................................................ 70 PRECISION ............................................................................................................................. 71 FRACTIONS ......................................................................................................................... 71 MIXED DECIMAL FRACTIONS WITH LARGE WHOLE PARTS ............................ 71 VERY LARGE NUMBER ................................................................................................... 71 Page II NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) VERY SMALL NUMBER ................................................................................................... 71 RANGE .................................................................................................................................. 72 OPERATORS ........................................................................................................................... 72 ARITHMETIC OPERATORS ............................................................................................ 72 RELATIONAL OPERATORS ............................................................................................ 72 BOOLEAN OPERATORS ................................................................................................... 73 EXPRESSIONS ....................................................................................................................... 74 EXAMPLES OF LEGAL NUMERIC EXPRESSIONS ................................................... 74 EXAMPLES OF ILLEGAL NUMERIC EXPRESSIONS ............................................... 74 ORDER OF EVALUATION OF OPERATORS ................................................................ 74 USING ARRAYS ........................................................................................................................ 75 INDEXING AND SUBSCRIPTING ...................................................................................... 75 MULTIPLE DIMENSION ARRAYS..................................................................................... 75 DEFAULT DIMENSIONS ...................................................................................................... 76 ARRAYS MAY NOT BE REDIMENSIONED ..................................................................... 76 ARRAY REFERENCES IN NUMERIC EXPRESSIONS ................................................... 77 USING STRINGS ....................................................................................................................... 78 STRING CONSTANTS ........................................................................................................... 78 THE NULL STRING............................................................................................................... 78 STRING VARIABLES ............................................................................................................ 78 DIMENSIONING STRING VARIABLES ......................................................................... 78 SUBSTRINGS .......................................................................................................................... 79 THE OPEN ENDED SUBSTRING..................................................................................... 79 STRING CONCATENATION ............................................................................................... 79 STRING FUNCTIONS ........................................................................................................... 80 STRING EXPRESSIONS ....................................................................................................... 80 STRING COMPARISONS ..................................................................................................... 80 ASSIGNMENT TO STRINGS AND SUBSTRINGS............................................................ 81 MAXIMUM LENGTH AND CURRENT LENGTH ........................................................... 82 CHARACTER SET IN BASIC .............................................................................................. 82 FORMATTED PRINTING ....................................................................................................... 84 REGULAR AND E FORMAT NUMBER PRINTING ........................................................ 84 WHAT IS A FORMATTED NUMBER? ............................................................................... 84 RIGHT JUSTIFICATION ...................................................................................................... 85 DECIMAL PLACES ............................................................................................................... 86 DEFAULT FORMAT AND CURRENT FORMAT .............................................................. 87 OTHER FORMAT CHARACTERS ..................................................................................... 87 EXAMPLES ............................................................................................................................. 88 EXECUTION AND CONTROL FLOW .................................................................................. 89 THE FOR NEXT LOOP ............................................................................................................ 90 BODY OF THE LOOP ............................................................................................................ 90 THE CONTROL VARIABLE AND THE LIMIT VALUE .................................................. 90 THE OPTIONAL STEP VALUE ........................................................................................... 90 NSB8 Rel. 5.10 Page III grifo(R) ITALIAN TECHNOLOGY FOR LOOP NESTING ............................................................................................................ 91 THE OPTIONAL CONTROL VARIABLE IN NEXT ......................................................... 92 USING EXIT ............................................................................................................................ 92 EXITING FROM NESTED LOOPS ..................................................................................... 93 SUBROUTINES ......................................................................................................................... 94 FILES ........................................................................................................................................... 96 FILE NAMES .......................................................................................................................... 96 FILE SIZES (LENGTHS) ...................................................................................................... 97 FILE TYPES ............................................................................................................................ 97 OPENING FILES .................................................................................................................... 97 CLOSING FILES .................................................................................................................... 97 TYPES OF DATA ELEMENTS IN FILES ........................................................................... 98 DATA ACCESS ........................................................................................................................ 98 SEQUENTIAL ACCESS ......................................................................................................... 98 APPENDING TO SEQUENTIAL FILES ........................................................................ 100 SEQUENTIAL BYTE ACCESS ........................................................................................ 100 RANDOM DATA ACCESS ................................................................................................... 101 MACHINE LANGUAGE SUBROUTINES ........................................................................... 103 CHAINING (AUTOMATIC PROGRAM SEQUENCING) ................................................. 105 COMMUNICATION BETWEEN CHAINED PROGRAMS ........................................... 105 TESTING FOR A SAFE CHAIN ......................................................................................... 105 ERROR TRAPPING AND RECOVERY ............................................................................... 106 THE LINE EDITOR ................................................................................................................ 108 NSB8 INTERNAL EDITOR ................................................................................................. 108 THE EDIT COMMAND ....................................................................................................... 109 LINE EDITOR SPECIFICS AND FUNCTIONS ............................................................... 110 CONTROL-G: COPY REST OF OLD LINE TO END OF NEW LINE ...................... 110 CONTROL-A: COPY ONE CHARACTER FOM OLD LINE ..................................... 110 CONTROL-Q: BACK UP ONE CHARACTER ..............................................................111 CONTROL-Z: ERASE ONE CHARACTER FOM OLD LINE ....................................111 CONTROL-D: COPY UP TO SPECIFIED CHARACTER ...........................................111 CONTROL-Y: SWITCH SPECIAL INSERT MODE ON AND OFF ............................111 CONTROL-N: CANCEL AND REEDIT NEW LINE .................................................... 112 COMPATIBILITY WITH OTHER BASICS ........................................................................ 113 STRING HANDLING ........................................................................................................... 113 ARRAY OF STRINGS .......................................................................................................... 113 STRING DECLARATIONS ................................................................................................. 113 INPUT TRANSLATION ....................................................................................................... 113 BCD ARITHMETIC ............................................................................................................. 114 IF ... THEN EVALUATION .................................................................................................. 114 Page IV NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) SPECIAL ENTRY POINTS .................................................................................................... 115 PERSONALIZING BASIC ..................................................................................................... 116 1 MEMORY SIZE ................................................................................................................. 117 2 SETTING A VARIABLE TO BASIC ORIGIN ............................................................... 117 3 LINE LENGTH .................................................................................................................. 117 4 VIDEO PAGING ................................................................................................................ 118 5 BACKSPACE CHARACTER ........................................................................................... 118 6 CONTROL-C INHIBIT ..................................................................................................... 119 7 NON STANDARD BOOTSTRAP PROM ........................................................................ 119 8 SHRINKING BASIC .......................................................................................................... 119 9 PROGRAM AUTOSTART ................................................................................................ 120 A CHART FOR READY REFERENCE ............................................................................. 121 NON STANDARD VERSIONS OF BASIC ........................................................................... 122 ABOUT NON STANDARD VERSIONS OF BASIC ......................................................... 122 DIFFERENT ORIGIN .......................................................................................................... 122 DIFFERENT PRECISIONS ................................................................................................. 122 IMPLEMENTATION NOTES ................................................................................................ 123 DISKETTE DATA STORAGE FORMATS ........................................................................ 123 FILE BUFFER SIZES, LIFETIMES OF BUFFERS ......................................................... 124 PRINT HEAD TABLE .......................................................................................................... 124 FILE HEADER TABLE........................................................................................................ 124 BASIC PROGRAM PRE PROCESSING ........................................................................... 124 THE INTERNAL FORM OF A PROGRAM ...................................................................... 125 USE OF RAM DURING PROGRAM EXECUTION ........................................................ 125 ERROR MESSAGE ................................................................................................................. 126 APPENDIX A: COMMAND FILE FOR GDOS 80 .............................................................. A-1 APPENDIX B: QUICK REFERENCE .................................................................................. B-1 FLAGS AND PARAMETER ................................................................................................ B-1 MEMORY SIZE SETTING ................................................................................................. B-1 INSTRUCTION CODES TABLE ........................................................................................ B-2 SOURCE FILE SYNTAX ..................................................................................................... B-3 DATA FILE SYNTAX ........................................................................................................... B-3 ARITHMETIC OPERATORS ............................................................................................. B-3 RELATIONALS OPERATORS ........................................................................................... B-3 BOOLEAN OPERATORS .................................................................................................... B-4 OPERATORS ORDER OF EVALUATION ....................................................................... B-4 FORMATTED PRINTING .................................................................................................. B-4 LINE EDITOR ....................................................................................................................... B-4 INTERNAL FUNCTIONS .................................................................................................... B-5 MATHEMATIC FUNCTIONS ......................................................................................... B-5 STRING FUNCTIONS ...................................................................................................... B-5 INPUT OUTPUT FUNCTIONS ........................................................................................ B-5 NSB8 Rel. 5.10 Page V grifo(R) ITALIAN TECHNOLOGY FILE FUNCTIONS ............................................................................................................ B-5 MISCELLANEOUS FUNCTIONS .................................................................................. B-5 USER DEFINED FUNCTIONS ........................................................................................... B-6 TERMS MEANING .............................................................................................................. B-6 DIRECT COMMANDS ........................................................................................................ B-6 STATEMENTS ...................................................................................................................... B-6 STATEMENTS FOR PROGRAM INTERNAL DATA MANAGEMENT ................... B-7 INPUT AND OUTPUT STATEMENTS ........................................................................... B-7 CONTROL STATEMENTS .............................................................................................. B-7 FILE STATEMENTS ......................................................................................................... B-7 GENERAL ISTATEMENTS ............................................................................................. B-7 TRAPPABLE ERRORS ........................................................................................................ B-8 APPENDIX C: ALPHABETICAL INDEX ............................................................................ C-1 Page VI NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) FIGURE INDEX FIGURE 1: NSB8 START UP SCREEN ................................................................................................... 4 FIGURE 2: FIRST COMMANDS AND INSTRUCTIONS SCREEN ................................................................... 5 FIGURE 3: LOAD AND RUN TOKENIZED DEMO PROGRAM SCREEN ......................................................... 5 FIGURE 4: LOAD AND RUN ASCII DEMO PROGRAM SCREEN .................................................................. 6 FIGURE B-1: INSTRUCTION CODES ................................................................................................ B-2 NSB8 Rel. 5.10 Page VII grifo(R) ITALIAN TECHNOLOGY Page VIII NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) INTRODUCTION The use of these devices has turned - IN EXCLUSIVE WAY - to specialized personnel. The purpose of this handbook is to give the necessary information to the cognizant and sure use of the products. They are the result of a continual and systematic elaboration of data and technical tests saved and validated from the manufacturer, related to the inside modes of certainty and quality of the information. The reported data are destined- IN EXCLUSIVE WAY- to specialized users, that can interact with the devices in safety conditions for the persons, for the machine and for the enviroment, impersonating an elementary diagnostic of breakdowns and of malfunction conditions by performing simple functional verify operations , in the height respect of the actual safety and health norms. The informations for the installation, the assemblage, the dismantlement, the handling, the adjustment, the reparation and the contingent accessories, devices etc. installation are destined - and then executable - always and in exclusive way from specialized warned and educated personnel, or directly from the TECHNICAL AUTHORIZED ASSISTANCE, in the height respect of the manufacturer recommendations and the actual safety and health norms. The devices can't be used outside a box. The user must always insert the cards in a container that rispect the actual safety normative. The protection of this container is not threshold to the only atmospheric agents, but specially to mechanic, electric, magnetic, etc. ones. To be on good terms with the products, is necessary guarantee legibility and conservation of the manual, also for future references. In case of deterioration or more easily for technical updates, consult the AUTHORIZED TECHNICAL ASSISTANCE directly. To prevent problems during card utilization, it is a good practice to read carefully all the informations of this manual. After this reading, the user can use the general index and the alphabetical index, respectly at the begining and at the end of the manual, to find information in a faster and more easy way. VERSIONS The present handbook is reported to the NSB8 version 1.2 and later. The validity of the bring informations is subordinate to the number of the firmware version. The user must always verify the correct correspondence among the two denotations. The version number is printed on the label attached on the diskette that contains the NSB8 package; this is the only valid version number and it is not self displayed by the program. NSB8 Rel. 5.10 Page 1 grifo(R) GENERAL FEATURES ITALIAN TECHNOLOGY NSB8 is a powerful software development tool which allows high-level programming in BASIC on all the grifo(R) boards based on Z80 microprocessor family. The code produced by NSB8 requires the functions and features of CP/M operating system or the similar rom-based operating system GDOS 80. The development environment is extremly friendly and achieves to reduce the development time, being anyway compliant to the operational feeling of all the BASICs. Unexperienced programmers will be able to take advantage of its numberouses commands and functions, becoming productive in few hours of work, while experienced programmers won't need any training. However the great code performance and the rapidity of hardware intervents make the NSB8 an unreplaceable work instrument for all the applications. The interpreter supports mathematic functions, control applications, data base management, interfacing to generic consoles, operating system calls and many other features designed to solve industrial automation problems. NSB8 is a programming and development environment made by a set of independent items that can be used or not by the programmer, without any limitation. Wishing to make comparisions amongst NSB8 and other well-known BASIC programming tools, we detect that NSB8 has an environment and instruction, command set comparable to the GWBASIC's one. NSB8 enables to take the greatest advantage of the hardware resources from the boards you are using, because you may use them directly through the high-level instructions, with no need to develop specific firmware. For example, NSB8 has the capacity to manage hardware resources like serial lines, printers, mass storage devices, operator interfaces, etc. Amongst the many characteristics of this development environment, we remind: - Numbered BASIC source code and automatic renumeration command. - Standard syntax; it allows to reuse code written and already tested on other BASIC programming environments. - Two different data types: floating point with 8 significant digits and string. - Wide range of operators including mathematical, relational, logical. - Complete set of mathematic functions including trigonometric and trascendental functions. - Support for the scientific notation that uses the significant digits in the best way. - Instruction set dedicated to the use of an operator interface. By means of these functions you may control the complete QTP xxx terrminals serie. - Wide range of GDOS 80 file system management instructions set. There is no more need for low-level memory and data area management. GDOS 80 takes care of this by manipulating data files, which can be created, deleted, downloaded, etc. - Interesting string manipulation instructions set (concatenation, conversion, test, etc.). - Powerful control flow instructions set, which allows to perform iterations, single or multiple tests, define functions and procedure, etc. - Basic low-level hardware resources management instructions set, like I/O instructions, direct memory access, absolute calls to external procedures etc. - High level devices management instructions set, which, by means of GDOS 80 features, allows easy use of peripherals like printers and serial lines. - No license fee or overcharge, developers are free to create programs without even informing grifo(R). As the software packages is under continuous development, please take care of the presence of an eventual file called "READ.ME" in the work disk. This file reports additions, modifications and improvements applied to the package and not yet reported in the manual; if the file is present it must be read, printed and attached to this manual. Page 2 NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) NSB8 REQUIREMENTS Only three elements are required to be immediatly up and running: 1) 2) 3) A Z80 based control board like GPC(R) 15A,GPC(R) 150, GPC(R) 15R, GPC(R) 153, GPC(R) 183, GPC(R) 154, GPC(R) 184, etc. The GDOS 80 operating system for the desired control board or a CP/M emulator as Z80MU. A personal computer, connected to the control board through a serial line. NOTE This manual uses the definition target board to refer to one of above reported grifo(R) hardware structures. RECEIVED MATERIAL The NSB8 software package is made by two disks that contains the software structure needen to work: NSB8 DISK The content of this disk is organized in directories, whose structure recalls the software package structure; we suggest to copy all the files into an unique work directory, like GDOS 80's one. Here follows a list of directories and files stored in this distribution disk: Root Contains all the most frequently used programs when operating with NSB8, which constitutes the main work structure: NSB8.G80 -> Executable NSB8 basic interpreter for GDOS 80 operating system. LEGGIMI.ITA -> Last minute addition to NSB8 documentation (Italian version) README.ENG -> Last minute addition to NSB8 documentation (English version) UTILITY directory Contains a set of utility programs and proper documentation files: BASTRA.G80 -> Reduce and optimize the application program BASTRA.DOC -> User documentation for BASTRA utility BASYM.G80 -> Create a table with the names of the simbols used in the application program BASYM.DOC -> User documentation for BASYM utility EXAMPLE directory Contains a set of demostration programs that show how to use the features of NSB8 programming language; this directory may include subdirectories containing demonstration programs for some cards, some defined hardware resources, etc. NSB8 USER MANUAL DISK It's the present manual and reports any technical information about NSB8. In detail this manual reports informations on instructions, commands, memory areas, program control, variables, etc. NSB8 Rel. 5.10 Page 3 grifo(R) HOW TO START ITALIAN TECHNOLOGY This chapter describes the operations to perform for a first, elementary use of the NSB8 software package. The following list of operations refers to the descriptions reported in the previous chapters, so please read them carefully. 1) 2) Install GDOS 80 operating system and make experience on its use. Copy into a work directory all the received disks contents. We suggest to use the GDOS 80 directory as the NSB8 work directory and to copy all the received files, even those saved on subdirectories, into this work directory. Read completely the received documentation (use ACROBAT READER on files with .PDF extension and any text editor on files with .DOC or .ENG extensions). Select the upper case (caps lock) on Your P.C. keyboard. 3) 4) 5)4) Run NSB8 programming language by typing: C:NSB8 -> if You load NSB8 from hard disk N:NSB8 -> if You load NSB8 from ROM disk and wait for the following screen: FIGURE 1: NSB8 START UP SCREEN 6) Type some NSB8 commands like: SCR CAT3 LIST and some NSB8 instructions like: PRINT "Hello world" PRINT 10/5,10/3,SQRT(100) and check the results listed in the following screen: Page 4 NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) FIGURE 2: FIRST COMMANDS AND INSTRUCTIONS SCREEN 7) Load a tokenized demo program from hard disk, print its text and run it by typing: LOAD DEMOT.B,3 LIST RUN FIGURE 3: LOAD AND RUN TOKENIZED DEMO PROGRAM SCREEN 8) Delete previous program, load an ascii demo program from hard disk and run it by typing: SCR ALOAD DEMOA ( = space) RUN Rel. 5.10 Page 5 NSB8 grifo(R) ITALIAN TECHNOLOGY FIGURE 4: LOAD AND RUN ASCII DEMO PROGRAM SCREEN 9) Add the following two instructions lines at the ascii demo program DEMOA.SOH: 15 PRINT "Program start" 50 PRINT 60 PRINT "Program stop" By using the GET80 integrated editor and save the obtained new source file. Repeat point 8 and check the results of the previous addition. At this point You are probably capable to use NSB8, so You can carry on testing all the instructions and all the provided demo programs. 10) 11) Please remember that the GET80 editor is really much more comfortable than NSB8 editor, so we suggest to always use it for Your application program development. Page 6 NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) ALOAD COMMAND: ALOAD followed by a number of space up to a total of 8 characters ACTION: The ascii BASIC program contained in the specified file is loaded into the program/data area and becomes the current program. EXAMPLES: ALOAD FILE NAME?: PROG2 ALOAD FILE NAME?: TST ( = space) ( = space) REMARKS: The specified file must be an ascii file with an empty first line. The ascii format is really usefull, for example to print it on paper or to modify it with an external text editor (i.e. GET80 one's). Unlike LOAD command, the successful ALOAD command doesn't perform a scratch of the program/data area before loading the program. ERROR MESSAGES: TOO LARGE OR NO PROGRAM ERROR HARD DISK ERROR FILE ERROR ARG ERROR TYPE ERROR See command LOAD and SAVE. SEE ALSO: Command ASCSAVE Command LOAD Command SCR NSB8 Rel. 5.10 Page 7 grifo(R) ITALIAN TECHNOLOGY APPEND COMMAND: APPEND ACTION: Appends the tokenized basic program in the specified file to the end of the current program. (the lowest line number in the specified program must be greater than the largest line number in the current program in order for an APPEND to be sucessful.) EXAMPLES: APPEND MYPROG APPEND TESTER,2 REMARKS: If there is no current program, APPEND acts like LOAD. A sucessful APPEND will always clear all variables in the program/data area. ERROR MESSAGES: LINE NUMBER ERROR The lowest number in the program to APPEND is less then or equal to the highest number in the current program. TOO LARGE OR NO PROGRAM ERROR Either there is not a valid BASIC program in the specified file, or the program wich would result from the APPEND operation is too large to fit into available memory. In the latter case, the current program remains unmodified. HARD DISK ERROR FILE ERROR ARG ERROR TYPE ERROR See command LOAD and SAVE. Page 8 NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) ASCSAVE COMMAND: ASCSAVE followed by a number of space up to a total of 8 characters ACTION: The current program is permanently saved into an ascii file on disk. EXAMPLES: ASCSAVE FILE NAME:? PROG2 ASCSAVE FILE NAME?: TST ( = space) ( = space) REMARKS: The ASCSAVE command is a special form of standard SAVE command and it can be used to save the current source program on a file with an ascii format. The ascii format is really usefull, for example to print it on paper or to modify it with an external text editor (i.e. GET80 one's). ERROR MESSAGES: ARG ERROR TYPE ERROR See command SAVE. SEE ALSO: Command SAVE Command ALOAD NSB8 Rel. 5.10 Page 9 grifo(R) ITALIAN TECHNOLOGY AUTO COMMAND: AUTO AUTO AUTO , ACTION: Initiates automatic line numbering mode, in which BASIC will automatically generate new line numbers for successive lines of program text. the specified line number will be the first line number used in auto-mode. Each successive automatically-supplied line number will be increlented from the last by the specified increment value. The increment value must be an integer in the range of 1 to 65535. An increment value may not be supplied unless an initial line number is also provided. When an initial line number or increment value is not given, it is assumed to be 10. EXAMPLES: AUTO AUTO 400 AUTO 1000,100 REMARKS: In automatic line numbering mode, a new line number will be printed at the start of every line. Auto-mode will persist until one of the following occurs: a) a carriage return is typed immediately after the line number; b) a line without a line number is typed (by using the NSB8 line editing capabilities to delete the line number from the beginning of the line); c) the next automatically generated line number would be greater then 65535. Note that if the "automatic" line numbers overlap existing lines in the current program, the existing lines will be REPLACED by the new ones. ERROR MESSAGES: OUT OF BOUNDS ERROR Either the initial line number, the increment value, or both are grater than 65535 or less than 0. ARG ERROR Either the initial line number, tha incremlent value, or both are negative, or non integers. SEE ALSO: Command REN Page 10 NSB8 Rel. 5.10 ITALIAN TECHNOLOGY grifo(R) BYE COMMAND: BYE ACTION: The current session with BASIC is terminated, and control returns to the GDOS. EXAMPLE: BYE REMARKS: The BYE command does not affect BASIC's program/data area in any way, so the current program and any data associated with it remain intact. It is possible to return to BASIC and resume work with the current program later, provided that the memory containing BASIC and its program/data area is not disturbed in the meantime. ERROR MESSAGES: None. SEE ALSO: Section SPECIAL ENTRY POINTS NSB8 Rel. 5.10 Page 11 grifo(R) ITALIAN TECHNOLOGY CAT COMMAND: CAT CAT CAT |