diff --git a/docs/acs.md b/docs/acs.md index a4d364c36..bd757033c 100644 --- a/docs/acs.md +++ b/docs/acs.md @@ -25,7 +25,7 @@ PRINT "Arc Cosine value of a is "; ACS(a) * This function is 100% Sinclair BASIC Compatible * If the given argument type is not float, it will be [converted](cast.md) to float before operating with it. -##See also +## See also * [SIN](sin.md) and [ASN](asn.md) * [TAN](tan.md) and [ATN](atn.md) diff --git a/docs/asn.md b/docs/asn.md index eac4f9b9c..8853bee9e 100644 --- a/docs/asn.md +++ b/docs/asn.md @@ -22,8 +22,8 @@ PRINT "Arc Sine value of a is "; ASN(a) ## Remarks -* This function is 100% Sinclair BASIC Compatible -* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it. +* This function is 100% Sinclair BASIC Compatible +* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it. ## See also diff --git a/docs/bin.md b/docs/bin.md new file mode 100644 index 000000000..d37e002d7 --- /dev/null +++ b/docs/bin.md @@ -0,0 +1,27 @@ +# BIN + +## Syntax + +``` +BIN +``` + + +## Description + +`BIN` is used to denote a binary number. It exists mostly for compatibility reasons with Sinclair BASIC. +You can denote a binary number by prefixing it with `BIN`, but also using the `%` prefix or the `b` suffix. + +For example, the number `5` can be denoted as follows: + + * `BIN 101` + * `101b` + * `%101` + +These three expressions are equivalent. + + +## Remarks + +* This keyword is 100% Sinclair BASIC Compatible +* Binary numbers are always considered unsigned integers and the type depends on the size of the number. diff --git a/docs/identifier.md b/docs/identifier.md index 9f9a3294d..2fa82fb4c 100644 --- a/docs/identifier.md +++ b/docs/identifier.md @@ -21,6 +21,7 @@ Identifiers shown in bold are taken from the Sinclair BASIC (beware their meanin * **[AT](at.md)** * **[ATN](atn.md)** **(function)** * **[bAND](bitwiselogic.md#bAND)** **(operator)** +* **[BIN](bin.md)** * **[bNOT](bitwiselogic.md#bNOT)** **(operator)** * **[bOR](bitwiselogic.md#bOR)** **(operator)** * **[bXOR](bitwiselogic.md#bXOR)** **(operator)** @@ -100,6 +101,7 @@ Identifiers shown in bold are taken from the Sinclair BASIC (beware their meanin * **[STOP](stop.md)** * **[STR](str.md)** **(function)** (Can also be written as **STR$**) * **[SUB](sub.md)** +* **[TAB](tab.md)** * **[TAN](tan.md)** **(function)** * **[THEN](if.md)** * **[TO](to.md)** diff --git a/docs/print.md b/docs/print.md index e1bf50424..16c9846de 100644 --- a/docs/print.md +++ b/docs/print.md @@ -67,11 +67,12 @@ PRINT "Variable 'a' contains the value: "; a ``` ## Changing the print position -You can change the current _cursor_ position using the [AT](at.md) modifier: +You can change the current _cursor_ position using the [AT](at.md) or [TAB](tab.md) modifiers: ``` PRINT AT 5, 0; "This message starts at ROW 5" PRINT AT 10, 10; "This message starts at ROW 10, COLUMN 10" +PRINT TAB 5; "This starts at column 5" ``` Again, you can chain all `PRINT` _items_ using semicolon: @@ -115,6 +116,7 @@ NEXT i * [CLS](cls.md) * [AT](at.md) +* [TAB](tab.md) * [PAPER](paper.md) * [BORDER](border.md) * [INVERSE](inverse.md) diff --git a/docs/requirements.txt b/docs/requirements.txt index d2b9df5b7..02ef8eea7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -19,7 +19,7 @@ packaging==24.2 paginate==0.5.7 pathspec==0.12.1 platformdirs==4.3.6 -Pygments==2.20.0 +Pygments==2.18.0 pymdown-extensions==10.16.1 python-dateutil==2.9.0.post0 PyYAML==6.0.2 diff --git a/docs/tab.md b/docs/tab.md new file mode 100644 index 000000000..adf404154 --- /dev/null +++ b/docs/tab.md @@ -0,0 +1,28 @@ +# TAB + +## Syntax +``` +PRINT TAB ; +``` + +`TAB` is not a statement, but a [PRINT](print.md) modifier. It is used to move the cursor to a specific column. +The ZX Spectrum screen has 32 columns, numbered from 0 to 31. + +When `TAB` is used, the cursor moves to the specified column. If the current position is already past the requested column, the cursor moves to that column on the next line. + + +``` +PRINT TAB 10; "Hello" +``` + +The above example will print "Hello" starting at column 10 of the current row. + +## Remarks +* This modifier is Sinclair BASIC compatible. +* If the value is 32 or more, it is taken modulo 32. + +## See also +* [PRINT](print.md) +* [AT](at.md) +* [POS](library/pos.md) +* [CSRLIN](library/csrlin.md)