Skip to content

Commit 1c70ae1

Browse files
authored
Merge pull request #1018 from boriel-basic/docs
Docs
2 parents 64db39c + 356400c commit 1c70ae1

File tree

12 files changed

+155
-54
lines changed

12 files changed

+155
-54
lines changed

docs/external_resources.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Other people contribute to it creating alternative IDEs, libraries, tools and ut
99
### Tommy Gun
1010
A free IDE created by [Tony Thompson](http://www.users.on.net/~tonyt73). This powerful tool is designed to create
1111
generic 8-bit and 16-bit projects, and can be set up to be used with ZX Basic.
12-
Have a look at the [TommyGun files](https://sourceforge.net/projects/tommygun/files/) page.
12+
Have a look at the [TommyGun files](https://sourceforge.net/projects/tommygun/files/) or [source code](https://github.com/tonyt73/TommyGun) pages.
1313

1414
To integrate ZX Basic with Tommy Gun, please follow this [tutorial](https://forum.boriel.com/showthread.php?tid=110).
1515

@@ -25,7 +25,7 @@ further information. The documentation of it is very well maintained.
2525

2626
* [Multipaint](http://multipaint.kameli.net/), a Java-based graphics editor that allows you to draw pictures with the color limitations of some typical screen formats from 8-bit computer platforms, like ZX Spectrum, C64 and Plus/4 high-resolution and multicolor, MSX 1 and Amstrad CPC0.
2727

28-
* [ZX-Paintbrush] (https://zx-modules.de/), a Windows graphics editor specifically for ZX-Spectrum screen formats, including multicolor.
28+
* [ZX-Paintbrush](https://zx-modules.jimdofree.com/), a Windows graphics editor specifically for ZX-Spectrum screen formats, including multicolor.
2929

3030
## Utilities
3131
Other generic utilities not above are:
@@ -45,13 +45,13 @@ There are several external engines that can be used within compiler to achieve e
4545
* [FASE](https://forum.boriel.com/showthread.php?tid=568)
4646
(or [here](https://forum.boriel.com/showthread.php?tid=575)), a sprite, tile and map engine.
4747
* [Nirvana](https://spectrumcomputing.co.uk/entry/30001/ZX-Spectrum/NIRVANA_ENGINE)
48-
(or [https://www.ime.usp.br/~einar/bifrost/ here]), a multicolour 8x2 (30x22 chars) graphics engine.
48+
(or [here](https://www.ime.usp.br/~einar/bifrost/)), a multicolour 8x2 (30x22 chars) graphics engine.
4949
* [Nirvana+](https://spectrumcomputing.co.uk/entry/30002/ZX-Spectrum/NIRVANA_ENGINE)
50-
(or [https://www.ime.usp.br/~einar/bifrost/ here]), a multicolour 8x2 (32x23 chars) graphics engine.
50+
(or [here](https://www.ime.usp.br/~einar/bifrost/)), a multicolour 8x2 (32x23 chars) graphics engine.
5151
* [Bifrost*](https://spectrumcomputing.co.uk/entry/27405/ZX-Spectrum/BIFROST*_ENGINE)
52-
(or [https://www.ime.usp.br/~einar/bifrost/ here]), a multicolour 8x1 (18x18 chars) graphics engine.
52+
(or [here](https://www.ime.usp.br/~einar/bifrost/)), a multicolour 8x1 (18x18 chars) graphics engine.
5353
* [Bifrost*2](https://spectrumcomputing.co.uk/entry/30003/ZX-Spectrum/BIFROST*2_ENGINE)
54-
(or [https://www.ime.usp.br/~einar/bifrost/ here]), a multicolour 8x1 (20x22 chars) graphics engine.
54+
(or [here](https://www.ime.usp.br/~einar/bifrost/)), a multicolour 8x1 (20x22 chars) graphics engine.
5555
* [Zxodus\]\[Engine](https://spectrumcomputing.co.uk/entry/26639/ZX-Spectrum/ZXodus_Engine)
5656
(or [here](https://forum.boriel.com/showthread.php?tid=568)), a 3d maze and RPG engine with
5757
multicolour 8x1 (18x18 chars) support.

docs/for.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
## Parameters
1111

1212
* _iterator_: a variable identifier that is used to iterate from an initial value to an end value.
13-
* _datatype_: If specified, the variable iterator will automatically be declared with the type datatype.
1413
* _startvalue_: an expression that denotes the starting value of the iterator.
1514
* _endvalue_: an expression used to compare with the value of the iterator.
1615
* _stepvalue_: an expression that is added to the iterator after every iteration.

docs/function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@ that can be ignored.
8080
* [ASM](asm.md)
8181
* [END](end.md)
8282
* [RETURN](return.md)
83+
* [DECLARE](declare.md)
8384
* [ByREF](byref.md)
8485
* [ByVAL](byval.md)

docs/identifier.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Note that there are a number of common statements that you may find in ZX BASIC
99

1010
## Reserved Identifiers
1111

12-
The following identifiers are _reserved words_, and can't be used as variables, functions or labels. Reserved identifiers are _case insensitive_ (it doesn't matter whether you write them in upper or lower case letters, or a mix of them). So **PRINT**, **print** and **PrInT** means all the same in ZX BASIC. On the other hand, non-reserved words can be either case sensitive or not (depending on the [options](options.md)) in effect.
12+
The following identifiers are _reserved words_, and can't be used as variables, functions or labels. Reserved identifiers are _case insensitive_ (it doesn't matter whether you write them in upper or lower case letters, or a mix of them). So **PRINT**, **print** and **PrInT** means all the same in ZX BASIC. On the other hand, non-reserved words can be either case sensitive or not (depending on the [options](zxb.md#command-line-options) in effect).
1313

1414
Identifiers shown in bold are taken from the Sinclair BASIC (beware their meaning here might be different, however). Some of them has been marked as _statements_, _functions_ or _operators_:
1515

@@ -120,7 +120,7 @@ You should also avoid defining (with a SUB or FUNCTION command) routines with th
120120
* **[CSRLIN (Library Function)](library/csrlin.md)** **(function)**
121121
* [HEX (Library Function)](library/hex.md) **(function)**
122122
* [HEX16 (Library Function)](library/hex.md) **(function)**
123-
* **[INPUT (Library Function)](library/input.md)** **(function)**
123+
* **[INPUT42 (Library Function)](library/input42.md)** **(function)**
124124
* **[GetKey (Library Function)](library/keys/getkey.md)** **(function)**
125125
* **[MultiKeys (Library Function)](library/keys/multikeys.md)** **(function)**
126126
* **[GetKeyScanCode (Library Function)](library/keys/getkeyscancode.md)** **(function)**

docs/library/attr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ PRINT AT 0, 0; "The attribute of screen position 9, 10 is "; s
3131
## See also
3232

3333
* [ CSRLIN ](csrlin.md)
34-
* [ POS](pos.md)
34+
* [ POS ](pos.md)
3535
* [ AT ](../at.md)

docs/library/csrlin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Syntax
44

5+
56
```
67
CSRLIN()
78
```
@@ -14,6 +15,7 @@ Returns the row (line) position of the text cursor (0 means the top line).
1415

1516
CSRLIN is a library function to be included with the following command:
1617

18+
1719
```
1820
# include <csrlin.bas>
1921
```

docs/library/hex.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# HEX/HEX16/HEX8
2+
3+
## Syntax
4+
5+
6+
```basic
7+
A$ = hex(n32)
8+
B$ = hex16(n16)
9+
C$ = hex8(n8)
10+
```
11+
Where `n32` is a 32-bit ULONG, `n16` is a 16-bit UINTEGER and `n8` is an 8-bit UBYTE.
12+
13+
## Description
14+
15+
* HEX:
16+
Takes one _32_ bit unsigned integer number and returns an 8 chars str containing the HEX string representation.
17+
* HEX16:
18+
Takes one _16_ bit unsigned integer number and returns a 4 chars str containing the HEX string representation.
19+
* HEX8:
20+
Takes one _8_ bit unsigned integer number and returns a 2 chars str containing the HEX string representation.
21+
22+
## Requirements
23+
24+
HEX, HEX16 and HEX8 can be included with the following command:
25+
26+
```
27+
#include <hex.bas>
28+
```
29+
30+
## Remarks
31+
32+
* This function is not available in Sinclair BASIC.
33+
* Avoid recursive / multiple inclusion when calling this function.
34+
* HEX16 ad HEX8 both call HEX to perform conversion, but differ in the size of the string they return.
35+
36+
## See also
37+

docs/library/input42.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Input42.bas
2+
3+
## INPUT42
4+
5+
Simple INPUT routine (not as powerful as Sinclair BASIC's), but this one uses the PRINT42 routine.
6+
Issues a cursor to the screen, waits for the user to type and returns the user's input through PRINT42 when the user presses ENTER.
7+
8+
## Syntax
9+
10+
```basic
11+
A$ = INPUT42(MaxChars)
12+
```
13+
MaxChars is the number of characters the INPUT42 function will accept as a maximum. It is a UINTEGER and thus has a maximum value of 65535.
14+
15+
## Requirements
16+
17+
INPUT42 is a library function that must be included before it can be used. Use the following directive:
18+
19+
```
20+
# include <input42.bas>
21+
```
22+
23+
## Remarks
24+
25+
* Note that this function ALWAYS RETURNS A STRING, which is very different from Sinclair BASIC's INPUT statement.
26+
* This function places the Input cursor at the last print position, not at the bottom of the screen. Remember that ZX Basic allows access to all 24 screen lines, so PRINT AT 24,0; sets the PRINT cursor to the bottom of the screen.
27+
* Avoid recursive / multiple inclusion
28+
* The input subroutine DOES NOT act like ZX Spectrum INPUT command
29+
* Uses ZX SPECTRUM ROM
30+
31+
## See also
32+
33+
* [ INKEY ](../inkey.md)
34+
* [ INPUT ](../input.md)
35+
* [ PRINT42 ](print42.bas.md)

docs/operators.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ which is _wrong_. If in doubt, use always parenthesis to enforce the desired eva
3939

4040
## Logical Operators
4141

42-
Logicals operators are like in ZX Spectrum Basic. Their result can be either _False_ (which is represented with 0)
43-
or _True_, which might be any other value. <u>Don't expect _True_ value number to be always **1**</u>.
44-
If you need 0/1 values for boolean evaluations, use `--strict-boolean` [compiler option](zxb.md#Command Line Options).
45-
This might add a little overhead to boolean evaluations, tough.
42+
Logicals operators are like in ZX Spectrum Basic. Their result can be either False
43+
(which is represented with 0) or True (represented by 1).
4644

4745
Operator arguments must be numbers and the result is an unsigned byte value. For binary operators,
4846
if arguments are of different types they are [converted](cast.md) to a common type before being evaluated:

docs/sub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SUB
22

3-
43
ZX Basic allows function and subroutines declarations. Sinclair Basic does not allow named subroutines, only calls with the GOSUB command.
54

65
A subroutine defined with the SUB statement is invoked directly. Unlike a [FUNCTION](function.md), a SUB does not return a value. This is the fundamental difference between code defined with SUB and code defined with FUNCTION. Other than that, the setup for SUB and FUNCTION are almost identical.
@@ -71,3 +70,4 @@ It will also issue a warning (perhaps you forgot to call it?), that can be ignor
7170
* [ASM](asm.md)
7271
* [END](end.md)
7372
* [RETURN](return.md)
73+
* [DECLARE](declare.md)

0 commit comments

Comments
 (0)