annotate basic/basic.txt @ 86:4967d1acd34a

add sbc09.asm
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 20 Aug 2018 00:48:11 +0900
parents 2088fd998865
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 TINY BASIC SUMMARY
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 Editing Standard Basic
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 Direct Mode All Verbs Usable
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 Statement Types
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 PRINT Item List
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 LET Var = Expr (LET is optional)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 IF Expr Relop Expr Statement
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 INPUT Variable List
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 GOTO Line Number
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GOSUB Line Number
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 RETURN
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 POKE POKE(Expr) = Expr
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 STOP
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 LIST Line Number, Line Number (Line Numbers are optional)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 RUN
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 NEW
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 Functions
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 USR Variable = USR(Expr,Expr)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 PEEK Variable = PEEK(Expr)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 MEM Variable = MEM
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 Number Integers to _+32767 or Hex Integers preceded by a $ symbol
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 Variable Letters A-Z
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 Expression Variables, Numbers, and Functions combined with the following
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 operators +, -, *, /, (, ).
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 Relop Comparison operators =, <, >, <=, >=, <>.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 Line Number Numbers 1 through 9999
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 String "ALPHANUMERICS"
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 Item List Expressions and Strings seperated by format control
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 characters , and ;.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 Control Chars. Control H or "Back Space" deletes last input character.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 Control X or "Cancel" deletes entire input line.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 Control C Terminates Basic program or List operation and
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 returns control to command mode.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 Memory Usage Tiny Basic V1.37
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 $0080 - $009F Tiny Basic interpreter scratch area.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 $00A0 - $00FD Not used by Tiny Basic interpreter. (usable USR routines)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 $**** - $**** Pointer to Interrupt Vector Table. (Identical to LILBUG)
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 $D800 - $DFFF Input Buffer, Basic Program storage, Stack Space, and
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 Variables in RAM.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 $**** - $**** Optional Power Up Basic Program and/or USR functions in ROM.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 $E800 - $EFFF Tiny Basic interpreter ROM.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 $E800 Cold Start Address.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 $E803 Warm Start Address.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 Tiny Basic USR Function
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 The USR function in Tiny Basic takes 2 arguments and returns a value to a
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 variable. The form of the USR function is "LET V = USR(Expr,Expr)".
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 The USR function can be used in any expression in Tiny Basic as an example
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 "LET V = A * ( B + USR( $EF00, K))". The USR function can also be used with
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 the PRINT statement.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 The first argument of the USR function is evaluated to determine the address
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 or the machine language code to be called. The second argument is evaluated
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 and the value is send to the machine code routine in the D accumulator. The
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 second argument is optional, if it is present the Carry bit in the condition
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 code register will be cleared when the machine code routine is called. If the
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 second argument is not present the Carry Bit will be set when the machine code
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 is called. The machine code routine may return a result to the BASIC program
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 in the D accumulator, the value in the D accumulator on return from the machine
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 code routine will be used by the BASIC program as the value of the function.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 The machine code routine must execute a RTS instruction to return conterol to
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 the BASIC program. The machine code routine may use all the processor registers
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 freely and need not save and restore any registers. It is important that the
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 machine code routine not modify any memory used by the Tiny Basic interpreter.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 Consult the memory map provided with your version of Tiny Basic to determine
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 which memory areas are not used.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 Tiny Basic handles interrupts with the same interrupt vectoring technique used
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 by LILBUG. Consult the LILBUG manual for details on interrupt vector usage.
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
2088fd998865 sbc09 directry clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 JPB 12-APR-82