Skip to content

Commit 62897c1

Browse files
billkendrickdmsc
authored andcommitted
Minor manual improvements (RAND/RND, arrays, GET)
Note that RAND(N) returns an integer number between 0 and N-1. Add "see also" notes to RAND() and RND(), to point to each other. Reminder of allow values in WORD vs BYTE arrays, and point out signed-ness. Explain that GET does not read certain keys (Start/Select/Option, Break/Reset, or Shift/Control on their own). Provide hints (memory locations to PEEK) to check the status of some of them (may be out of scope; perhaps FastBasic could add functions to test these?!) Also, some formatting corrections * Remove an extra blank in in "Hello [EOL] World" example output. * Make sure "EXEC" example appears correctly ("@**" at the end did something unexpected in Markdown)
1 parent 2960085 commit 62897c1

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

manual.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,11 @@ Arrays can be of four types:
535535
- `WORD` arrays (the default if no type
536536
is given) use two bytes of memory for
537537
each element, and works like normal
538-
numeric integer variables.
538+
numeric integer variables:
539+
-32768 to 32767 (signed).
539540
- `BYTE` arrays use only one byte for
540541
each element, so the numeric range
541-
is reduced from 0 to 255.
542+
is reduced from 0 to 255 (unsigned).
542543
- Floating point arrays, works like any
543544
floating point variable, and use six
544545
bytes of memory for each element.
@@ -579,7 +580,6 @@ constant, see this example:
579580
Will print:
580581

581582
Hello
582-
583583
world..
584584

585585

@@ -638,7 +638,7 @@ while this will print "GOOD"
638638

639639

640640
String Variables
641-
---------------
641+
----------------
642642

643643
The naming convention for string
644644
variables is the same as for numeric
@@ -740,7 +740,9 @@ and the abbreviated syntax.
740740
- RAND(_num_) / R.(_num_) :
741741
Returns a random, non negative
742742
number, a maximum of 1 less than
743-
_num_.
743+
_num_. (e.g., `RAND(3)` will result
744+
in 0, 1, or 2.)
745+
(See also `RND()`.)
744746

745747
- FRE() / F. :
746748
Returns the free memory available in
@@ -860,6 +862,7 @@ will return an invalid value, and the
860862
- RND() / RN. :
861863
Returns a random positive number
862864
strictly less than 1.
865+
(See also `RAND()`.)
863866

864867
- SIN(_n_) / SI.(_n_) : Sine of _n_.
865868

@@ -999,7 +1002,27 @@ Console Print and Input Statements
9991002
Waits for a keypress and writes the
10001003
key value to _var_, which can be a
10011004
variable name or an array position
1002-
(like "array(123)")
1005+
(like "array(123)").
1006+
1007+
Note: Some keys on the Atari -- the
1008+
console keys `START`, `SELECT`, and
1009+
`OPTION`; modifiers `SHIFT` and
1010+
`CONTROL`; and the `HELP`, `BREAK`,
1011+
and `RESET` keys -- are not handled
1012+
in the same way as the main keyboard,
1013+
and cannot be read by `GET`.
1014+
1015+
Hints: The status of all three console
1016+
keys may be read via the GTIA `CONSOL`
1017+
register, `PEEK(53279)`.
1018+
1019+
Whether the `HELP` key is pressed
1020+
can be detected via the POKEY `KBCODE`
1021+
register, `PEEK(53769)`.
1022+
1023+
Whether either `SHIFT` key is pressed
1024+
can be detected via the POKEY `SKCTL`
1025+
register, `PEEK(53775)`.
10031026

10041027

10051028
**Input Variable Or String**
@@ -1206,7 +1229,7 @@ Control Statements
12061229

12071230

12081231
**Calls A Subroutine**
1209-
**EXEC _name_ _num1_, ... / EXE. / @**
1232+
**EXEC _name_ _num1_, ... / EXE. / @ **
12101233

12111234
Calls the subroutine _name_, with the
12121235
optional parameters _num1_ and so on,

0 commit comments

Comments
 (0)