@nataliapc/mcp-openmsx 1.1.14 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -12
- package/dist/server.js +198 -69
- package/dist/utils.js +54 -7
- package/dist/vectordb.js +60 -0
- package/package.json +10 -3
- package/resources/audio/MGSC111.txt +669 -0
- package/resources/audio/msx-midi.md +872 -0
- package/resources/audio/opl4tech.txt +688 -0
- package/resources/audio/psg_registers.md +281 -0
- package/resources/audio/sound_cartridge_scc.md +123 -0
- package/resources/audio/sound_cartridge_scci.md +250 -0
- package/resources/audio/toc.json +18 -7
- package/resources/book--msx2-technical-handbook/toc.json +1 -1
- package/resources/msx-unapi/toc.json +2 -2
- package/resources/processors/toc.json +4 -4
- package/resources/processors/z80_detailed_instruction_set.md +80 -68
- package/resources/programming/basic_wiki/ABS().md +36 -0
- package/resources/programming/basic_wiki/AND.md +71 -0
- package/resources/programming/basic_wiki/ASC().md +38 -0
- package/resources/programming/basic_wiki/ATN().md +36 -0
- package/resources/programming/basic_wiki/AUTO.md +39 -0
- package/resources/programming/basic_wiki/BASE().md +147 -0
- package/resources/programming/basic_wiki/BEEP.md +27 -0
- package/resources/programming/basic_wiki/BIN$().md +36 -0
- package/resources/programming/basic_wiki/BLOAD.md +63 -0
- package/resources/programming/basic_wiki/BSAVE.md +61 -0
- package/resources/programming/basic_wiki/CALL.md +391 -0
- package/resources/programming/basic_wiki/CALL_ADJUST.md +40 -0
- package/resources/programming/basic_wiki/CALL_IMPOSE.md +28 -0
- package/resources/programming/basic_wiki/CALL_OPTIONS.md +26 -0
- package/resources/programming/basic_wiki/CALL_PAUSE.md +119 -0
- package/resources/programming/basic_wiki/CALL_PCMPLAY.md +60 -0
- package/resources/programming/basic_wiki/CALL_PCMREC.md +70 -0
- package/resources/programming/basic_wiki/CDBL().md +36 -0
- package/resources/programming/basic_wiki/CHR$().md +51 -0
- package/resources/programming/basic_wiki/CINT().md +36 -0
- package/resources/programming/basic_wiki/CIRCLE.md +51 -0
- package/resources/programming/basic_wiki/CLEAR.md +39 -0
- package/resources/programming/basic_wiki/CLOAD.md +27 -0
- package/resources/programming/basic_wiki/CLOAD?.md +31 -0
- package/resources/programming/basic_wiki/CLOSE.md +44 -0
- package/resources/programming/basic_wiki/CLS.md +51 -0
- package/resources/programming/basic_wiki/COLOR.md +143 -0
- package/resources/programming/basic_wiki/COLOR=.md +93 -0
- package/resources/programming/basic_wiki/COLOR_SPRITE$().md +83 -0
- package/resources/programming/basic_wiki/COLOR_SPRITE().md +85 -0
- package/resources/programming/basic_wiki/CONT.md +23 -0
- package/resources/programming/basic_wiki/COPY.md +215 -0
- package/resources/programming/basic_wiki/COPY_SCREEN.md +61 -0
- package/resources/programming/basic_wiki/COS().md +37 -0
- package/resources/programming/basic_wiki/CSAVE.md +35 -0
- package/resources/programming/basic_wiki/CSNG().md +36 -0
- package/resources/programming/basic_wiki/CSRLIN.md +33 -0
- package/resources/programming/basic_wiki/DATA.md +47 -0
- package/resources/programming/basic_wiki/DEFDBL.md +40 -0
- package/resources/programming/basic_wiki/DEFINT.md +40 -0
- package/resources/programming/basic_wiki/DEFSNG.md +40 -0
- package/resources/programming/basic_wiki/DEFSTR.md +40 -0
- package/resources/programming/basic_wiki/DEF_FN.md +49 -0
- package/resources/programming/basic_wiki/DEF_USR.md +33 -0
- package/resources/programming/basic_wiki/DELETE.md +49 -0
- package/resources/programming/basic_wiki/DIM.md +59 -0
- package/resources/programming/basic_wiki/DRAW.md +77 -0
- package/resources/programming/basic_wiki/ELSE.md +45 -0
- package/resources/programming/basic_wiki/END.md +32 -0
- package/resources/programming/basic_wiki/EOF().md +36 -0
- package/resources/programming/basic_wiki/EQV.md +76 -0
- package/resources/programming/basic_wiki/ERASE.md +35 -0
- package/resources/programming/basic_wiki/ERL.md +34 -0
- package/resources/programming/basic_wiki/ERR.md +143 -0
- package/resources/programming/basic_wiki/ERROR.md +145 -0
- package/resources/programming/basic_wiki/EXP().md +38 -0
- package/resources/programming/basic_wiki/FIELD.md +48 -0
- package/resources/programming/basic_wiki/FIX().md +44 -0
- package/resources/programming/basic_wiki/FN.md +61 -0
- package/resources/programming/basic_wiki/FOR...NEXT.md +80 -0
- package/resources/programming/basic_wiki/FRE().md +66 -0
- package/resources/programming/basic_wiki/GET_DATE.md +60 -0
- package/resources/programming/basic_wiki/GET_TIME.md +34 -0
- package/resources/programming/basic_wiki/GOSUB.md +41 -0
- package/resources/programming/basic_wiki/GOTO.md +41 -0
- package/resources/programming/basic_wiki/HEX$().md +36 -0
- package/resources/programming/basic_wiki/IF...GOTO...ELSE.md +55 -0
- package/resources/programming/basic_wiki/IF...THEN...ELSE.md +50 -0
- package/resources/programming/basic_wiki/IMP.md +83 -0
- package/resources/programming/basic_wiki/INKEY$.md +65 -0
- package/resources/programming/basic_wiki/INP().md +33 -0
- package/resources/programming/basic_wiki/INPUT$().md +51 -0
- package/resources/programming/basic_wiki/INPUT.md +93 -0
- package/resources/programming/basic_wiki/INSTR().md +44 -0
- package/resources/programming/basic_wiki/INT().md +44 -0
- package/resources/programming/basic_wiki/INTERVAL.md +57 -0
- package/resources/programming/basic_wiki/KEY().md +51 -0
- package/resources/programming/basic_wiki/KEY.md +254 -0
- package/resources/programming/basic_wiki/LEFT$().md +39 -0
- package/resources/programming/basic_wiki/LEN().md +36 -0
- package/resources/programming/basic_wiki/LET.md +68 -0
- package/resources/programming/basic_wiki/LINE.md +74 -0
- package/resources/programming/basic_wiki/LINE_INPUT.md +79 -0
- package/resources/programming/basic_wiki/LIST.md +58 -0
- package/resources/programming/basic_wiki/LLIST.md +43 -0
- package/resources/programming/basic_wiki/LOAD.md +56 -0
- package/resources/programming/basic_wiki/LOCATE.md +67 -0
- package/resources/programming/basic_wiki/LOG().md +36 -0
- package/resources/programming/basic_wiki/LPOS().md +31 -0
- package/resources/programming/basic_wiki/LPRINT.md +46 -0
- package/resources/programming/basic_wiki/MAXFILES.md +39 -0
- package/resources/programming/basic_wiki/MERGE.md +54 -0
- package/resources/programming/basic_wiki/MID$().md +72 -0
- package/resources/programming/basic_wiki/MOD.md +39 -0
- package/resources/programming/basic_wiki/MOTOR.md +46 -0
- package/resources/programming/basic_wiki/NEW.md +27 -0
- package/resources/programming/basic_wiki/NOT.md +61 -0
- package/resources/programming/basic_wiki/OCT$().md +36 -0
- package/resources/programming/basic_wiki/ON...GOSUB.md +45 -0
- package/resources/programming/basic_wiki/ON...GOTO.md +42 -0
- package/resources/programming/basic_wiki/ON_ERROR_GOTO.md +61 -0
- package/resources/programming/basic_wiki/ON_INTERVAL_GOSUB.md +54 -0
- package/resources/programming/basic_wiki/ON_KEY_GOSUB.md +56 -0
- package/resources/programming/basic_wiki/ON_SPRITE_GOSUB.md +41 -0
- package/resources/programming/basic_wiki/ON_STOP_GOSUB.md +56 -0
- package/resources/programming/basic_wiki/ON_STRIG_GOSUB.md +70 -0
- package/resources/programming/basic_wiki/OPEN.md +103 -0
- package/resources/programming/basic_wiki/OR.md +75 -0
- package/resources/programming/basic_wiki/OUT.md +35 -0
- package/resources/programming/basic_wiki/PAD().md +110 -0
- package/resources/programming/basic_wiki/PAINT.md +66 -0
- package/resources/programming/basic_wiki/PDL().md +53 -0
- package/resources/programming/basic_wiki/PEEK().md +44 -0
- package/resources/programming/basic_wiki/PLAY().md +58 -0
- package/resources/programming/basic_wiki/PLAY.md +196 -0
- package/resources/programming/basic_wiki/POINT.md +52 -0
- package/resources/programming/basic_wiki/POKE.md +51 -0
- package/resources/programming/basic_wiki/POS().md +36 -0
- package/resources/programming/basic_wiki/PRESET.md +61 -0
- package/resources/programming/basic_wiki/PRINT.md +179 -0
- package/resources/programming/basic_wiki/PSET.md +82 -0
- package/resources/programming/basic_wiki/PUT_KANJI.md +93 -0
- package/resources/programming/basic_wiki/PUT_SPRITE.md +143 -0
- package/resources/programming/basic_wiki/READ.md +45 -0
- package/resources/programming/basic_wiki/REM.md +42 -0
- package/resources/programming/basic_wiki/RENUM.md +78 -0
- package/resources/programming/basic_wiki/RESTORE.md +52 -0
- package/resources/programming/basic_wiki/RESUME.md +45 -0
- package/resources/programming/basic_wiki/RETURN.md +47 -0
- package/resources/programming/basic_wiki/RIGHT$().md +39 -0
- package/resources/programming/basic_wiki/RND().md +51 -0
- package/resources/programming/basic_wiki/RUN.md +56 -0
- package/resources/programming/basic_wiki/SAVE.md +65 -0
- package/resources/programming/basic_wiki/SCREEN.md +164 -0
- package/resources/programming/basic_wiki/SET_ADJUST.md +66 -0
- package/resources/programming/basic_wiki/SET_BEEP.md +76 -0
- package/resources/programming/basic_wiki/SET_DATE.md +103 -0
- package/resources/programming/basic_wiki/SET_PAGE.md +52 -0
- package/resources/programming/basic_wiki/SET_PASSWORD.md +75 -0
- package/resources/programming/basic_wiki/SET_PROMPT.md +61 -0
- package/resources/programming/basic_wiki/SET_SCREEN.md +100 -0
- package/resources/programming/basic_wiki/SET_SCROLL.md +55 -0
- package/resources/programming/basic_wiki/SET_TIME.md +83 -0
- package/resources/programming/basic_wiki/SET_TITLE.md +87 -0
- package/resources/programming/basic_wiki/SET_VIDEO.md +49 -0
- package/resources/programming/basic_wiki/SGN().md +38 -0
- package/resources/programming/basic_wiki/SIN().md +36 -0
- package/resources/programming/basic_wiki/SOUND.md +188 -0
- package/resources/programming/basic_wiki/SPACE$().md +38 -0
- package/resources/programming/basic_wiki/SPC().md +34 -0
- package/resources/programming/basic_wiki/SPRITE$().md +50 -0
- package/resources/programming/basic_wiki/SPRITE.md +31 -0
- package/resources/programming/basic_wiki/SQR().md +32 -0
- package/resources/programming/basic_wiki/STICK().md +70 -0
- package/resources/programming/basic_wiki/STOP.md +70 -0
- package/resources/programming/basic_wiki/STR$().md +37 -0
- package/resources/programming/basic_wiki/STRIG().md +82 -0
- package/resources/programming/basic_wiki/STRING$().md +42 -0
- package/resources/programming/basic_wiki/SWAP.md +62 -0
- package/resources/programming/basic_wiki/TAB().md +38 -0
- package/resources/programming/basic_wiki/TAN().md +36 -0
- package/resources/programming/basic_wiki/TIME.md +59 -0
- package/resources/programming/basic_wiki/TROFF.md +21 -0
- package/resources/programming/basic_wiki/TRON.md +39 -0
- package/resources/programming/basic_wiki/USR().md +66 -0
- package/resources/programming/basic_wiki/VAL().md +36 -0
- package/resources/programming/basic_wiki/VARPTR().md +50 -0
- package/resources/programming/basic_wiki/VDP().md +103 -0
- package/resources/programming/basic_wiki/VPEEK().md +46 -0
- package/resources/programming/basic_wiki/VPOKE.md +48 -0
- package/resources/programming/basic_wiki/WAIT.md +38 -0
- package/resources/programming/basic_wiki/WIDTH.md +76 -0
- package/resources/programming/basic_wiki/XOR.md +72 -0
- package/resources/programming/basic_wiki/_toc.json +871 -0
- package/resources/sdcc/sdccman.lyx +81574 -0
- package/resources/sdcc/toc.json +77 -0
- package/vector-db/index.json +1 -0
- /package/resources/msx-unapi/{Ethernet_UNAPI_specification_1.1.md → Ethernet_UNAPI_specification_1_1.md} +0 -0
- /package/resources/msx-unapi/{MSX_UNAPI_specification_1.1.md → MSX_UNAPI_specification_1_1.md} +0 -0
- /package/resources/processors/{Z80_R800_instruction_set.md → z80_r800_instruction_set.md} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# GET TIME
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Reads the time in the SRAM of the Real Time Clock (RTC) on MSX2 and higher machines.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`GET TIME <StringVariable>,A`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
`<StringVariable>` is a string variable that will contain the time in the format "HH:MM:SS". HH for the hour digits, MM for the minutes digits and SS for the seconds digits.
|
|
14
|
+
|
|
15
|
+
When `A` is specified, the alarm time that you have entered with `SET TIME` will be read. SS value is "00". If no any alarm time has been entered, HH and MM values are also "00" (no effect on almost all MSXs).
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```basic
|
|
20
|
+
GET TIME A$:PRINT A$
|
|
21
|
+
20:27:43
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Related to
|
|
25
|
+
|
|
26
|
+
`GET DATE`, `SET DATE`, `SET TIME`
|
|
27
|
+
|
|
28
|
+
## Compatibility
|
|
29
|
+
|
|
30
|
+
MSX-BASIC 2.0 or higher
|
|
31
|
+
|
|
32
|
+
## Source
|
|
33
|
+
|
|
34
|
+
Retrieved from "https://www.msx.org/wiki/GET_TIME"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GOSUB
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Calls a subroutine located on the specified line number.
|
|
6
|
+
|
|
7
|
+
The subroutine must be terminated with the `RETURN` instruction, to resume program execution with the instruction specified directly after `GOSUB` (on the same line or the next line), except if `RETURN` is followed by a line number.
|
|
8
|
+
|
|
9
|
+
## Syntax
|
|
10
|
+
|
|
11
|
+
`GOSUB <LineNumber>`
|
|
12
|
+
|
|
13
|
+
## Parameter
|
|
14
|
+
|
|
15
|
+
`<LineNumber>` is a program line number of your subroutine.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```basic
|
|
20
|
+
10 GOSUB 100
|
|
21
|
+
20 PRINT "Now it's my turn!"
|
|
22
|
+
30 END
|
|
23
|
+
100 PRINT "Me first!"
|
|
24
|
+
110 RETURN
|
|
25
|
+
|
|
26
|
+
RUN
|
|
27
|
+
Me first!
|
|
28
|
+
Now it's my turn!
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Related to
|
|
32
|
+
|
|
33
|
+
`GOTO`, `ON...GOSUB`, `ON INTERVAL GOSUB`, `ON KEY GOSUB`, `ON SPRITE GOSUB`, `ON STOP GOSUB`, `ON STRIG GOSUB`, `RETURN`
|
|
34
|
+
|
|
35
|
+
## Compatibility
|
|
36
|
+
|
|
37
|
+
MSX-BASIC 1.0 or higher
|
|
38
|
+
|
|
39
|
+
## Source
|
|
40
|
+
|
|
41
|
+
Retrieved from "https://www.msx.org/wiki/GOSUB"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GOTO
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Jumps to the specified line number and executes the instructions from there.
|
|
6
|
+
|
|
7
|
+
## Syntaxes
|
|
8
|
+
|
|
9
|
+
`GOTO <LineNumber>`
|
|
10
|
+
|
|
11
|
+
`GO TO <LineNumber>`
|
|
12
|
+
|
|
13
|
+
## Parameter
|
|
14
|
+
|
|
15
|
+
`<LineNumber>` is a line number of your MSX program.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```basic
|
|
20
|
+
10 GOTO 100
|
|
21
|
+
20 PRINT "Now it's my turn!"
|
|
22
|
+
30 END
|
|
23
|
+
100 PRINT "Me first!"
|
|
24
|
+
110 GOTO 20
|
|
25
|
+
|
|
26
|
+
RUN
|
|
27
|
+
Me first!
|
|
28
|
+
Now it's my turn!
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Related to
|
|
32
|
+
|
|
33
|
+
`GOSUB`, `ON...GOTO`, `ON ERROR GOTO`
|
|
34
|
+
|
|
35
|
+
## Compatibility
|
|
36
|
+
|
|
37
|
+
MSX-BASIC 1.0 or higher
|
|
38
|
+
|
|
39
|
+
## Source
|
|
40
|
+
|
|
41
|
+
Retrieved from "https://www.msx.org/wiki/GOTO"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# HEX$()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Returns a string with the hexadecimal representation of a value.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`HEX$(<Value>)`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`<Value>` must be an expression, a numeric variable or a value between -32768 and 65535. A single or double precision value can be used but digits after the decimal point will be ignored.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```basic
|
|
18
|
+
10 PRINT "The hexadecimal representation of 8 is ";HEX$(8)
|
|
19
|
+
20 PRINT "The hexadecimal representation of 127 is ";HEX$(127)
|
|
20
|
+
|
|
21
|
+
RUN
|
|
22
|
+
The hexadecimal representation of 8 is 8
|
|
23
|
+
The hexadecimal representation of 127 is 7F
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Related to
|
|
27
|
+
|
|
28
|
+
`BIN$`, `OCT$`
|
|
29
|
+
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
MSX-BASIC 1.0 or higher
|
|
33
|
+
|
|
34
|
+
## Source
|
|
35
|
+
|
|
36
|
+
Retrieved from "https://www.msx.org/wiki/HEX$()"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# IF...GOTO...ELSE
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Checks if a condition has been met and jumps to the number line specified after `GOTO`. Optionally, if the condition has not been met the instruction(s) after `ELSE` will be run.
|
|
6
|
+
|
|
7
|
+
_Note: If you use the Exprif BASIC extension, no need to use this instruction!_
|
|
8
|
+
|
|
9
|
+
## Syntaxes
|
|
10
|
+
|
|
11
|
+
`IF <ConditionExpression> GOTO <LineNumber> ELSE <LineNumber>`
|
|
12
|
+
|
|
13
|
+
`IF <ConditionExpression> GOTO <LineNumber> ELSE <BASICinstruction>:<BASICinstruction>:...`
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
`<ConditionExpression>` is an expression false (whose result is zero) or true (whose result is non-zero). For example, the expression A<>9 is equal to 0 if A is different from 9 otherwise the result is -1.
|
|
18
|
+
|
|
19
|
+
`<LineNumber>` is a line number of the program in memory.
|
|
20
|
+
|
|
21
|
+
`<BASICinstruction>` can be any MSX-BASIC instruction. When there are several BASIC instructions, they must be separated by the character colon.
|
|
22
|
+
|
|
23
|
+
`ELSE` can be omitted when it is not followed by one or more BASIC instructions or a program line number, that will be executed when the condition is false.
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
```basic
|
|
28
|
+
10 A=1: IF A GOTO 30
|
|
29
|
+
20 PRINT "A=0":END
|
|
30
|
+
30 PRINT "A is different from 0":END
|
|
31
|
+
|
|
32
|
+
RUN
|
|
33
|
+
A is different from 0
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```basic
|
|
37
|
+
10 CLS
|
|
38
|
+
20 PRINT "Hello!"
|
|
39
|
+
30 TIME = 0
|
|
40
|
+
40 IF INKEY$="" GOTO 40
|
|
41
|
+
50 IF TIME <4 GOTO 50
|
|
42
|
+
60 IF INKEY$="" GOTO 60 ELSE 20
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Related to
|
|
46
|
+
|
|
47
|
+
`IF...THEN...ELSE`
|
|
48
|
+
|
|
49
|
+
## Compatibility
|
|
50
|
+
|
|
51
|
+
MSX-BASIC 1.0 or higher
|
|
52
|
+
|
|
53
|
+
## Source
|
|
54
|
+
|
|
55
|
+
Retrieved from "https://www.msx.org/wiki/IF...GOTO...ELSE"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# IF...THEN...ELSE
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Checks if a condition has been met and executes the instruction(s) specified after `THEN`. Optionally, if the condition has not been met the instruction(s) after `ELSE` will be run.
|
|
6
|
+
|
|
7
|
+
_Note: If you use the Exprif BASIC extension, no need to use this instruction!_
|
|
8
|
+
|
|
9
|
+
## Syntaxes
|
|
10
|
+
|
|
11
|
+
`IF <ConditionExpression> THEN <LineNumber> ELSE <LineNumber>`
|
|
12
|
+
|
|
13
|
+
`IF <ConditionExpression> THEN <LineNumber> ELSE <BASICinstruction>:<BASICinstruction>:...`
|
|
14
|
+
|
|
15
|
+
`IF <ConditionExpression> THEN <BASICinstruction>:<BASICinstruction>:... ELSE <LineNumber>`
|
|
16
|
+
|
|
17
|
+
`IF <ConditionExpression> THEN <BASICinstruction>:<BASICinstruction>:... ELSE <BASICinstruction>:<BASICinstruction>:...`
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
`<ConditionExpression>` is an expression false (whose result is zero) or true (whose result is non-zero). For example, the expression `A>5` is equal to 0 if `A` is less than 6 otherwise the result is -1.
|
|
22
|
+
|
|
23
|
+
`<LineNumber>` is a line number of the program in memory.
|
|
24
|
+
|
|
25
|
+
`<BASICinstruction>` can be any MSX-BASIC instruction. When there are several BASIC instructions, they must be separated by the character colon.
|
|
26
|
+
|
|
27
|
+
`ELSE` can be omitted when it is not followed by one or more BASIC instructions or a program line number, that will be executed when the condition is false.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```basic
|
|
32
|
+
10 INPUT "What is your age";A
|
|
33
|
+
20 IF A < 18 THEN PRINT "You are way too young to be playing Starship Rendezvous":END ELSE PRINT "Good for you!"
|
|
34
|
+
|
|
35
|
+
RUN
|
|
36
|
+
What is you age?
|
|
37
|
+
Good for you!
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Related to
|
|
41
|
+
|
|
42
|
+
`IF...GOTO...ELSE`
|
|
43
|
+
|
|
44
|
+
## Compatibility
|
|
45
|
+
|
|
46
|
+
MSX-BASIC 1.0 or higher
|
|
47
|
+
|
|
48
|
+
## Source
|
|
49
|
+
|
|
50
|
+
Retrieved from "https://www.msx.org/wiki/IF...THEN...ELSE"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# IMP
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Performs a bitwise `IMP`-operation (logical implication) between two expressions.
|
|
6
|
+
|
|
7
|
+
The logical implication can be read as the condition _"if p is true, q is also true"_. On the other hand, if p is false, the condtion still holds and thus the value of `p IMP q` is true.
|
|
8
|
+
|
|
9
|
+
The truth table of p IMP q is:
|
|
10
|
+
```
|
|
11
|
+
0 IMP 0 = 1
|
|
12
|
+
0 IMP 1 = 1
|
|
13
|
+
1 IMP 0 = 0
|
|
14
|
+
1 IMP 1 = 1
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This operation is equivalent to: `((NOT first_operand) OR second_operand)`
|
|
18
|
+
|
|
19
|
+
## Syntax
|
|
20
|
+
|
|
21
|
+
`<Value> IMP <Value>`
|
|
22
|
+
|
|
23
|
+
## Parameter
|
|
24
|
+
|
|
25
|
+
`<Value>` is a value between -32768 and 32767. It can also be a numeric variable, an mathematical expression or expression from a condition.
|
|
26
|
+
|
|
27
|
+
_Notes:_
|
|
28
|
+
- If you use binary expressions, it is best to put the first expression in parenthesis to avoid the bug in interpreter that causes a syntax error. This problem does not happen with decimal, hexadecimal or octal expressions.
|
|
29
|
+
- When the expression is performed in a condition (`IF...THEN...ELSE` or `IF...GOTO...ELSE`), if the result of the whole expression is zero the value is taken as false, otherwise it's taken as true.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
```basic
|
|
34
|
+
10 ' Continue only after user has (pressed and) released SPACE-key:
|
|
35
|
+
20 S=LE:LE=STRIG(0):IF SIMPLE GOTO 20
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```basic
|
|
39
|
+
PRINT 15 IMP 11
|
|
40
|
+
-5
|
|
41
|
+
```
|
|
42
|
+
Binary explanation:
|
|
43
|
+
```
|
|
44
|
+
0000000000001111
|
|
45
|
+
0000000000001011 IMP
|
|
46
|
+
----------------
|
|
47
|
+
1111111111111011
|
|
48
|
+
```
|
|
49
|
+
-5 is actually the number 65531
|
|
50
|
+
|
|
51
|
+
```basic
|
|
52
|
+
PRINT 5 IMP 13
|
|
53
|
+
-1
|
|
54
|
+
```
|
|
55
|
+
Binary explanation:
|
|
56
|
+
```
|
|
57
|
+
0000000000000101
|
|
58
|
+
0000000000001101 IMP
|
|
59
|
+
----------------
|
|
60
|
+
1111111111111111
|
|
61
|
+
```
|
|
62
|
+
-1 is actually the number 65535
|
|
63
|
+
|
|
64
|
+
```basic
|
|
65
|
+
PRINT &B00001111 IMP &B11110001
|
|
66
|
+
Syntax error
|
|
67
|
+
Ok
|
|
68
|
+
PRINT (&B00001111) IMP &B11110001
|
|
69
|
+
-15
|
|
70
|
+
```
|
|
71
|
+
-15 is actually the number 65521
|
|
72
|
+
|
|
73
|
+
## Related to
|
|
74
|
+
|
|
75
|
+
`AND`, `EQV`, `MOD`, `NOT`, `OR`, `XOR`
|
|
76
|
+
|
|
77
|
+
## Compatibility
|
|
78
|
+
|
|
79
|
+
MSX-BASIC 1.0 or higher
|
|
80
|
+
|
|
81
|
+
## Source
|
|
82
|
+
|
|
83
|
+
Retrieved from "https://www.msx.org/wiki/IMP"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# INKEY$
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Returns either a single character read from the keyboard or (if no key is pressed) an empty string.
|
|
6
|
+
|
|
7
|
+
This instruction can be combined with `CHR$()` to check if a specific key has been pressed. It's useful not only for the alphanumeric keys, but also the cursor keys, the spacebar or another special key.
|
|
8
|
+
|
|
9
|
+
However, if you want to make your game or application compatible with joysticks, it's better to directly use the `STICK()` and `STRIG()` instructions.
|
|
10
|
+
|
|
11
|
+
## Syntax
|
|
12
|
+
|
|
13
|
+
`INKEY$`
|
|
14
|
+
|
|
15
|
+
## Special keys common to all MSX machines
|
|
16
|
+
|
|
17
|
+
|Code for CHRS()|Key|Alternative <sup>*</sup>|
|
|
18
|
+
|:-:|:-:|:--|
|
|
19
|
+
|8|BS||
|
|
20
|
+
|9|TAB||
|
|
21
|
+
|11|HOME||
|
|
22
|
+
|12|CLS||
|
|
23
|
+
|13|RETURN||
|
|
24
|
+
|18|INS||
|
|
25
|
+
|24|SELECT||
|
|
26
|
+
|27|ESC||
|
|
27
|
+
|28|→|`STICK(n) = 3`|
|
|
28
|
+
|29|←|`STICK(n) = 7`|
|
|
29
|
+
|30|↑|`STICK(n) = 1`|
|
|
30
|
+
|31|↓|`STICK(n) = 5`|
|
|
31
|
+
|32|SPACE|`STRIG(n) = -1`|
|
|
32
|
+
|127|DEL||
|
|
33
|
+
|
|
34
|
+
<sup>(*)</sup> n is a value between 0 and 2 for `STICK()`, 0 and 4 for `STRIG()`
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
```basic
|
|
39
|
+
10 A$=INKEY$
|
|
40
|
+
20 IF A$="" THEN 10
|
|
41
|
+
30 PRINT "You pressed ";A$;" - CHR$(";ASC(A$);")"
|
|
42
|
+
|
|
43
|
+
RUN
|
|
44
|
+
You pressed M - CHR$( 77 )
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
_Note: The result will be an 'empty' character with some special keys._
|
|
48
|
+
|
|
49
|
+
```basic
|
|
50
|
+
10 A$=INKEY$
|
|
51
|
+
20 IF A$=CHR$(28) THEN 30 ELSE 10
|
|
52
|
+
30 PRINT "You pressed the key to move the cursor to the right"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Related to
|
|
56
|
+
|
|
57
|
+
`CHR$()`, `INPUT$`, `STICK()`, `STRIG()`
|
|
58
|
+
|
|
59
|
+
## Compatibility
|
|
60
|
+
|
|
61
|
+
MSX-BASIC 1.0 or higher
|
|
62
|
+
|
|
63
|
+
## Source
|
|
64
|
+
|
|
65
|
+
Retrieved from "https://www.msx.org/wiki/INKEY$"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# INP()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Returns the value of an input port.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`INP(<PortNumber>)`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`<PortNumber>` is the I/O port number to read. It needs to be between 0 and 255.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```basic
|
|
18
|
+
10 A=INP(&HA8)
|
|
19
|
+
20 A$="00000000"+BIN$(A)
|
|
20
|
+
30 PRINT RIGHT$(A$,8)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Related to
|
|
24
|
+
|
|
25
|
+
`OUT`, `SOUND`, `VDP()`, `WAIT`
|
|
26
|
+
|
|
27
|
+
## Compatibility
|
|
28
|
+
|
|
29
|
+
MSX-BASIC 1.0 or higher
|
|
30
|
+
|
|
31
|
+
## Source
|
|
32
|
+
|
|
33
|
+
Retrieved from "https://www.msx.org/wiki/INP()"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# INPUT$()
|
|
2
|
+
|
|
3
|
+
## Effet
|
|
4
|
+
|
|
5
|
+
Returns a string characters of defined length retrieved from the keyboard or a sequential file.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`INPUT$(<Number>,#<FileNumber>)`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
`<Number>` is the number of characters to retrieve.
|
|
14
|
+
|
|
15
|
+
`#` precedes file number. It is optional and has no effect.
|
|
16
|
+
|
|
17
|
+
`<FileNumber>` is the number of file assigned to the sequential file opened with the `OPEN` command.
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
```basic
|
|
22
|
+
10 A$=INPUT$(3)
|
|
23
|
+
20 PRINT A$
|
|
24
|
+
|
|
25
|
+
RUN
|
|
26
|
+
MSX
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```basic
|
|
30
|
+
10 OPEN "CAS:DATA" FOR INPUT AS #1
|
|
31
|
+
20 IF EOF(1) THEN 40
|
|
32
|
+
30 A$=INPUT$(3,1) : PRINT A$ : GOTO 20
|
|
33
|
+
40 CLOSE#1 : END
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Data
|
|
37
|
+
|
|
38
|
+
- The data retrieved from the keyboard or a sequential file are stored in only one value (not several values) and it's always a string (never a number).
|
|
39
|
+
- `INPUT$` accepts all characters, especially the control-sequences (with exception for CTRL/C). Therefore `INPUT$` is useful for data transfer from other machines. In such transmissions all characters might be important.
|
|
40
|
+
|
|
41
|
+
## Related to
|
|
42
|
+
|
|
43
|
+
`CLOSE`, `EOF`, `INKEY$`, `INPUT`, `LINE INPUT`, `OPEN`, `PRINT`
|
|
44
|
+
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
MSX-BASIC 1.0 or higher
|
|
48
|
+
|
|
49
|
+
## Source
|
|
50
|
+
|
|
51
|
+
Retrieved from "https://www.msx.org/wiki/INPUT$()"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# INPUT
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Retrieves data from the keyboard or reads data from a sequential file, storing the input (strings or numbers) into variables.
|
|
6
|
+
|
|
7
|
+
## Syntaxes
|
|
8
|
+
|
|
9
|
+
`INPUT "<Prompt>"; <Variable>,<Variable>...`
|
|
10
|
+
|
|
11
|
+
`INPUT#<FileNumber>,<Variable>,<Variable>...`
|
|
12
|
+
|
|
13
|
+
_Note: Parameters can not end with a comma alone._
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
`<Prompt>` is the text displayed that will be followed by a question mark to ask what you need to input. String variable is ignored.
|
|
18
|
+
|
|
19
|
+
`<Variable>` is a numeric/string variable that will take the input value/string. We can add variables to enter a series of values, each separated by a comma.
|
|
20
|
+
|
|
21
|
+
`<FileNumber>` is the number of file opened by `OPEN`.
|
|
22
|
+
|
|
23
|
+
_Note: Using this parameter does not go to text screen mode when the instruction is executed in a graphic screen mode, and with device `"CON"` only the characters that has been typed will be retrieved, other characters on same input line will not be retrieved._
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
```basic
|
|
28
|
+
10 INPUT "What is your favorite computer system";A$
|
|
29
|
+
20 PRINT A$
|
|
30
|
+
|
|
31
|
+
RUN
|
|
32
|
+
What is your favorite computer system?
|
|
33
|
+
MSX
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```basic
|
|
37
|
+
10 INPUT "What is your preferred number";A
|
|
38
|
+
20 PRINT A
|
|
39
|
+
|
|
40
|
+
RUN
|
|
41
|
+
What is your preferred number?
|
|
42
|
+
13
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```basic
|
|
46
|
+
10 OPEN "CAS:DATA" FOR INPUT AS #1
|
|
47
|
+
20 IF EOF(1) THEN 40
|
|
48
|
+
30 INPUT#1,X$,Y$,Z$ : PRINT X$,Y$,Z$ : GOTO 20
|
|
49
|
+
40 CLOSE#1 : END
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```basic
|
|
53
|
+
10 COLOR 15,4,4:SCREEN 2
|
|
54
|
+
20 OPEN"con" FOR INPUT AS #1
|
|
55
|
+
30 INPUT#1,A$: CLOSE#1
|
|
56
|
+
40 PSET(124-(LEN(A$)*4),92),4
|
|
57
|
+
50 OPEN"grp:" AS #1
|
|
58
|
+
60 PRINT#1,A$: CLOSE#1
|
|
59
|
+
70 IF NOT STRIG(0) THEN 70 ' Press Space key to exit
|
|
60
|
+
80 END
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Data
|
|
64
|
+
|
|
65
|
+
### Retrieved from keyboard
|
|
66
|
+
|
|
67
|
+
You need to enter as many values as in the `INPUT` command and they need to be separated by a comma. Strings are accepted, but if they include a comma they need to be surrounded with `"` (Input format is similar to `DATA` statement).
|
|
68
|
+
|
|
69
|
+
If there's an error in the entered values, the message _? Redo from start_ is displayed and the `INPUT` command is executed again.
|
|
70
|
+
|
|
71
|
+
If values are missing `??` is displayed and user is given possibility to enter the missing value(s).
|
|
72
|
+
|
|
73
|
+
In case of too many values are given a message `? Extra ignored` will be displayed and the program will continue without storing the extra values.
|
|
74
|
+
|
|
75
|
+
If a string or number already has a value and the new input is empty (only Return/Enter pressed on the keyboard) then the old value remains unchanged.
|
|
76
|
+
|
|
77
|
+
### Read from sequential file
|
|
78
|
+
|
|
79
|
+
If the values are read from a sequential file, the variables on this file need to be in the same order than the variables of the `INPUT` command.
|
|
80
|
+
|
|
81
|
+
In case of strings on a sequential file, the end of the string is determined by a comma, RETURN or Line Feed. However, if the first character of the string is a quotation mark `"` then the second quotation mark is viewed as the end of the string.
|
|
82
|
+
|
|
83
|
+
## Related to
|
|
84
|
+
|
|
85
|
+
`CLOSE`, `EOF`, `INPUT$`, `LINE INPUT`, `OPEN`, `PRINT`
|
|
86
|
+
|
|
87
|
+
## Compatibility
|
|
88
|
+
|
|
89
|
+
MSX-BASIC 1.0 or higher
|
|
90
|
+
|
|
91
|
+
## Source
|
|
92
|
+
|
|
93
|
+
Retrieved from "https://www.msx.org/wiki/INPUT"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# INSTR()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Returns the position of the first occurrence of a substring in a specified string, this from a specified position.
|
|
6
|
+
|
|
7
|
+
Special values:
|
|
8
|
+
- 0 if the specified string is empty OR the substring is not found in the string OR the starting position is higher than the length of the string.
|
|
9
|
+
- value of starting position if the required substring is empty AND the specified string is not empty AND the starting position is not higher than the length of the string.
|
|
10
|
+
|
|
11
|
+
_Note: For strings with Japanese or Korean characters, you need to use `CALL KINSTR`._
|
|
12
|
+
|
|
13
|
+
## Syntax
|
|
14
|
+
|
|
15
|
+
`INSTR(<Start>,"<String1>","<String2>")`
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
`<Start>` is the starting position in the string to find the substring. The first character in the string is numbered 1. The highest possible position is 255. When omitted, the search will start from the first character.
|
|
20
|
+
|
|
21
|
+
`<String1>` and `<String2>` are strings of characters between double quotes `"`. They can include non-printable characters and be replaced by a numeric or string variable (also named as alphanumeric variable).
|
|
22
|
+
|
|
23
|
+
`<String2>` is the substring to be found in `<String1>`.
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```basic
|
|
28
|
+
10 PRINT INSTR("I like MSX!","MSX");
|
|
29
|
+
|
|
30
|
+
RUN
|
|
31
|
+
8
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Related to
|
|
35
|
+
|
|
36
|
+
`CALL KINSTR`, `LEN`
|
|
37
|
+
|
|
38
|
+
## Compatibility
|
|
39
|
+
|
|
40
|
+
MSX-BASIC 1.0 or higher
|
|
41
|
+
|
|
42
|
+
## Source
|
|
43
|
+
|
|
44
|
+
Retrieved from "https://www.msx.org/wiki/INSTR()"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# INT()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Returns the largest integer equal to or smaller than a variable.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`INT (<Expression>)`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`<Expression>` can be a value, a numeric variable or an mathematical expression.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```basic
|
|
18
|
+
10 PRINT "INT(1.23) results in ";INT(1.23)
|
|
19
|
+
20 PRINT "INT(-1.99) results in ";INT(-1.99)
|
|
20
|
+
30 PRINT "INT(-1.01) results in ";INT(-1.01)
|
|
21
|
+
|
|
22
|
+
RUN
|
|
23
|
+
INT(1.23) results in 1
|
|
24
|
+
INT(-1.99) results in -2
|
|
25
|
+
INT(-1.01) results in -2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Difference between FIX, INT and CINT
|
|
29
|
+
|
|
30
|
+
When the variable is negative, `INT` gives the next lower number, whereas `FIX` merely truncates the numbers after the decimal point. `FIX(x)` is equivalent to `INT(ABS(x))*SGN(x)`.
|
|
31
|
+
|
|
32
|
+
`CINT` is similar to `FIX`, but the integer part is limited between -32768 and 32767.
|
|
33
|
+
|
|
34
|
+
## Related to
|
|
35
|
+
|
|
36
|
+
`ABS()`, `CINT()`, `FIX()`, `SGN()`
|
|
37
|
+
|
|
38
|
+
## Compatibility
|
|
39
|
+
|
|
40
|
+
MSX-BASIC 1.0 or higher
|
|
41
|
+
|
|
42
|
+
## Source
|
|
43
|
+
|
|
44
|
+
Retrieved from "https://www.msx.org/wiki/INT()"
|