home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / acorn / 8629 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  5.7 KB

  1. Path: sparky!uunet!mcsun!uknet!acorn!rwilson
  2. From: RWilson@acorn.co.uk
  3. Newsgroups: comp.sys.acorn
  4. Subject: Really! BASIC V in 3.10
  5. Message-ID: <18454@acorn.co.uk>
  6. Date: 10 Sep 92 17:35:38 GMT
  7. Sender: rwilson@acorn.co.uk
  8. Lines: 159
  9.  
  10. ARM BBC BASIC V: changes between 1.04 and 1.05
  11.  
  12. (1) BASIC V is internationalised. @% can be set to print "," instead of ".".
  13. All messages are printed via BASICTrans (see TransDoc).
  14.  
  15. (2) INSTALL was treated as a statement permitting a variety of lethal, innocent
  16. looking BASIC programs along the lines of:
  17.  
  18.   10 INSTALL"foo"
  19.  
  20. which wipes out a substantial portion of the interpreter's stack: an error,
  21. local array or any structure causes mayhem. 1.05 series interpreters treat
  22. programs like this as bad: an error is issued if the INSTALL is encountered.
  23. INSTALL is now implemented as a command (and it is therefore impossible to edit
  24. the line containing an INSTALL to the state that a 1.04 interpreter left it).
  25.  
  26. (3) ADR with bit 1 clear in OPT (0, 2, ..) will no longer give an error in the
  27. circumstance when the label is out of range. (Also bad immediate fields will
  28. not fault).
  29.  
  30. (4) Fatal errors are *only* 0
  31.  
  32. (5) @% goes ANSI C
  33.  
  34. @% is now reported by LVAR in ANSI printf format - one of g, e or f formats
  35. followed by the field width, a dot and the precision. @% is also settable
  36. using this format - @%="G10.9" corresponds to the default. There is now a
  37. HELP message on @% and the formats.
  38.  
  39. Partial setting of @% is supported:
  40.  
  41. @%="+":REM turn on STR$
  42. @%="G":REM go to G format (turns off STR$)
  43. @%="10":REM set just the field width for current format (turns off STR$)
  44. @%=".5":REM set just the precision for current format (turns of STR$)
  45. @%="+F10":REM turn on STR$, go to F format and set field width 10
  46. @%="E10.3":REM go to E format, field width 10, 3 digits in total
  47. @%="+F20.4":REM turn on STR$, go to F, field width 20, 4 digits after '.'
  48.  
  49. Spaces cannot be used. LET @%= does not cope with the string form. Replace
  50. "." with "," to get "," used as the decimal point character.
  51.  
  52. (6) Improved error messages from libraries
  53.  
  54. The interpreter will tag the error message with the name of the library
  55. which caused the error message (found from the REM on the first line of a
  56. library.
  57.  
  58. (7) INPUT# floating values
  59.  
  60. Both the 5 byte real (&80, value) and the 8 byte real (&88, value) are
  61. accepted by the interpreter.
  62.  
  63. (8) Sped up array statements
  64.  
  65. The following have been sped up by some factor between 3 and 10:
  66.  
  67. foo()=<expression>
  68. foo%()=<expression>
  69. foo()=fie()
  70. foo%()=fie%()
  71. DIM foo(, foo$(, foo%(
  72.  
  73. (9) END= may be used almost anywhere
  74.  
  75. Useable anywhere except with INSTALLed libraries, nested within EVAL or LOCAL
  76. ERROR, nested within assignments to local arrays, nested local arrays.
  77.  
  78. Example:
  79.  
  80.    10DIM A(10)
  81.    20A(1)=10
  82.    30PROCb
  83.    40PRINTA(1)
  84.    50END
  85.    60DEF PROCb
  86.    70LOCAL A()
  87.    80DIM A(2)
  88.    90A(1)=EXP1
  89.   100PROCMoveEnd(&40000)
  90.   110PRINTA(1)
  91.   120ENDPROC
  92.   130DEF PROCMoveEnd(a)
  93.   140LOCAL A()
  94.   150DIM A(10)
  95.   160A(1)=PI
  96.   170END=a
  97.   180PRINT A(1)
  98.   190ENDPROC
  99.  
  100. is incorrect since there is a nested local array in PROCb. A direct call to
  101. PROCMoveEnd with no other nested A() would be OK. The interpreter is capable of
  102. detecting the above situation, but can be confused by an EVAL which contains a
  103. END=.
  104.  
  105. HIMEM gets reset, local arrays cleared if faulty.
  106.  
  107. (10) TRACE to file
  108.  
  109. TRACE output can be directed to a file with TRACE TO "<file name>": all TRACE
  110. output is sent to the file until TRACE CLOSE is issued [the interpreter will
  111. close the trace file before exit]. Note that errors found when writing to this
  112. file will result in it being closed and forgotten about. The variable TRACE
  113. allows the programmer to output other things to the trace file (e.g. with
  114. IF TRACE THEN BPUT#TRACE,"X is "+STR$X)
  115.  
  116. Note that TRACE now allows line number and PROC tracing to be on together:
  117. TRACE PROC:TRACE ON (say).
  118.  
  119. (11) TEXTLOAD and TEXTSAVE commands
  120.  
  121. TEXTLOAD <string expression>
  122. TEXTSAVE[O <expression>,] <string expression>
  123.  
  124. As well as the obvious, TEXTLOAD (and BASIC -load) are safer in that they have
  125. (generally) more free memory to convert the program in than BASIC 1.04 which is
  126. stuck with 4096 bytes.
  127.  
  128. (12) CRUNCH command
  129.  
  130. CRUNCH <expression> Strips various spaces from program.
  131. bit 0 = 1: spaces before statements
  132. bit 1 = 1: spaces in statements
  133. bit 2 = 1: REM statements (except on first line)
  134. bit 3 = 1: empty statements
  135. bit 4 = 1: empty lines
  136.  
  137. Notes:
  138.  
  139. (a) Programs with -quit set will be CRUNCH %1111 and LIBRARY and INSTALL sub
  140. programs will be CRUNCH %1111. CRUNCH %10 may make a program uneditable.
  141. OVERLAYs will not be CRUNCHed.
  142.  
  143. (b) BASIC V 1.04 cannot read assembler statements that have been crunched: such
  144. things as EORR4,R4,R5 give it terminal heart burn.
  145.  
  146. (c) The interpreter has been optimised for fully crunched programs.
  147.  
  148. (d) CRUNCHing away empty lines will give problems to programs with GOTO (GOSUB,
  149. IF THEN, RESTORE) in them which rely on the target being an empty line (or line
  150. of empty statements or REM statement). RESTORE+ might give a problem if
  151. intervening lines are removed.
  152.  
  153. (13) Bugs fixed
  154.  
  155. 17-Nov-88   Fixed TAN1E-5 bug (misread the flow chart in Cody and Waite!)
  156. 02-Dec-88   -1^-10 blew up
  157. 14-Mar-89   " unlistable token " not terminated by >&7F
  158. 15-Jun-89   F1XSUB, F1SUB could return -0 which various xxSTAs can't cope with
  159. 17-Jul-89   Difference between IF THENELSE and IF THEN ELSE fixed
  160. 18-Aug-89   Cache not being flushed on errors could cause problems with EVAL
  161. 12-Oct-89   Bug in printing 0 in E mode removed
  162. 17-Oct-89   INT-(3*2^30) didn't give error
  163. 19-Oct-89   Assembler OPT not reset on -chain or -quit
  164. 24-Oct-89   A()=B() messed up
  165. 03-Nov-89   Change to ADVAL to return all 32 bits
  166. 11-Dec-89   TRACE TO "printer:" didn't work because of the type setting
  167.  
  168. [Plus other things which I have forgotten!]
  169.