Category:MSX-BASIC Instructions
This page was last modified 13:58, 16 February 2017 by Gdx. Based on work by Mars2000you and Rderooy.

Below is a list of all standard MSX-BASIC instructions, that are not linked to a localisation (Arabic, Japanese, Korean), the presence or addition of a device such as a disk drive or a RS-232C interface, or the using of a program that adds specific new instructions.

These instructions are classified according to their purpose. For a general overview of all instructions in alphabetical order, see this page : MSX-BASIC Instructions.

Generally, all instructions corresponding to a MSX generation will also work on the higher generations, but there are some exceptions, especially the instructions related to the data recorder will not work on MSX Turbo R.

Although the instructions added by MSX-BASIC 4.0 (MSX Turbo R) begin with CALL, they need to be included in the standard MSX-BASIC instructions, even if they have the typical syntax of an extension.

For all the instructions that are not part of the standard MSX-BASIC instructions, first check this page: MSX-BASIC Extensions.

A few instructions are standard instructions while being at the same time linked to a specific MSX-BASIC extension. The most obvious case is COPY added by the Disk BASIC extension and also present on all MSX2 (and higher) computers as a graphic instruction.

Contents

Arithmetical operators

Instruction Generation Updates Related extensions / Remarks
- MSX1 Subtraction
+ MSX1 Addition
/ MSX1 Division
\ or ¥ MSX1 Division without a digit after the decimal point in result -
\ must be replaced by ¥ on a Japanese MSX
* MSX1 Multiplication
^ MSX1 Root squared
MOD MSX1 Rest resulting of a division

Call/Return, Jump and Loop

Instruction Generation Updates Related extensions / Remarks
FOR...NEXT MSX1
GOSUB MSX1
GOTO MSX1
RETURN MSX1

Clock & Timing

Instruction Generation Updates Related extensions / Remarks
CALL PAUSE MSX Turbo R Short version: _PAUSE
INTERVAL MSX1
GET DATE MSX2 Related to Real Time Clock (RTC)
GET TIME MSX2 Related to Real Time Clock (RTC)
ON INTERVAL GOSUB MSX1
SET DATE MSX2 Related to Real Time Clock (RTC)
SET TIME MSX2 Related to Real Time Clock (RTC)
TIME MSX1
WAIT MSX1

Conditions

Instruction Generation Updates Related extensions / Remarks
< MSX1 Checks if the first argument is inferior to the second
> MSX1 Checks if the first argument is superior to the second
= MSX1 Checks if the first argument is equal to the second
IF...GOTO...ELSE MSX1
IF...THEN...ELSE MSX1
ON...GOSUB MSX1
ON...GOTO MSX1

Conversion Functions

Instruction Generation Updates Related extensions / Remarks
ASC() MSX1
BIN$() MSX1
CHR$() MSX1
HEX$() MSX1
INSTR MSX1
LEN() MSX1
OCT$() MSX1
STR$() MSX1
VAL() MSX1

Data Recording

Instruction Generation Updates Related extensions / Remarks
BLOAD MSX1 Disk BASIC
BSAVE MSX1 Disk BASIC
CLOAD MSX1
CLOAD? MSX1
CLOSE MSX1 Disk BASIC, QuickDisk BASIC, MemoryDisk BASIC, RS-232C BASIC
CSAVE MSX1
EOF() MSX1 Data input function
LOAD MSX1 Disk BASIC, MemoryDisk BASIC, RS-232C BASIC
MAXFILES MSX1
MERGE MSX1 Disk BASIC, MemoryDisk BASIC, RS-232C BASIC
MOTOR MSX1
OPEN MSX1 Disk BASIC, QuickDisk BASIC, MemoryDisk BASIC, RS-232C BASIC
RUN MSX1 Disk BASIC, MemoryDisk BASIC
SAVE MSX1 Disk BASIC, MemoryDisk BASIC, RS-232C BASIC
VARPTR() MSX1 Data input function

Note: The Data Recorder support has been removed from the MSX Turbo R.

Display

Instruction Generation Updates Related extensions / Remarks
BASE MSX1 MSX2, MSX2+ Instruction for VDP experts
CIRCLE MSX1
CLS MSX1
COLOR MSX1 MSX2, MSX2+ Kanji BASIC, Hangul BASIC
COLOR= MSX2
COPY MSX2 It is the standard MSX2 instruction and must not be confused with the COPY instruction added by the Disk BASIC
COPY SCREEN MSX2 Optional, can be used only on machines with an internal or external digitizer
CSRLIN MSX1
DRAW MSX1
LINE MSX1 MSX2
LOCATE MSX1
LPOS() MSX1 Data input function
OPEN MSX1
PAINT MSX1
POINT MSX1 Data input function
POS() MSX1 Data input function
PRESET MSX1 MSX2
PRINT MSX1
PSET MSX1 MSX2
PUT KANJI MSX2 Related to Kanji BASIC
SCREEN MSX1 MSX2, MSX2+ Hangul BASIC, Kanji BASIC
SET ADJUST MSX2 Related to Real Time Clock (RTC)
SET PAGE MSX2
SET SCROLL MSX2+
SET VIDEO MSX2 Optional, can be used only on machines with an internal or external digitizer
SPC() MSX1
TAB() MSX1
VDP() MSX1 MSX2, MSX2+ Instruction for VDP experts
VPEEK() MSX1 MSX2 Data input function
VPOKE MSX1 MSX2
WIDTH MSX1 MSX2 Hangul BASIC, Kanji BASIC

Errors Traitment

Instruction Generation Updates Related extensions / Remarks
ERL MSX1
ERR MSX1 Disk BASIC
ERROR MSX1 Disk BASIC
ON ERROR GOTO MSX1

Input/Output Bus

Instruction Generation Updates Related extensions / Remarks
INP() MSX1 Data input function
OUT MSX1

Keyboard and/or Controllers

Instruction Generation Updates Related extensions / Remarks
INKEY$ MSX1 Data input function
LINE INPUT MSX1
INPUT MSX1
INPUT$() MSX1 Data input function
KEY MSX1
KEY() MSX1
OPEN MSX1
ON KEY GOSUB MSX1
ON STOP GOSUB MSX1
ON STRIG GOSUB MSX1
PAD() MSX1 MSX2 Data input function, Light Pen support removed on MSX Turbo R
PDL() MSX1 Data input function, Paddle controllers support removed on MSX Turbo R, these devices are unused on MSXPLAYer.
STICK() MSX1 Data input function
STRIG() MSX1 Data input function

Logical operators

Instruction Generation Updates Related extensions / Remarks
AND MSX1
EQV MSX1
IMP MSX1
NOT MSX1
OR MSX1
XOR MSX1

Mathematical functions

Instruction Generation Updates Related extensions / Remarks
ABS() MSX1
CDBL() MSX1
CINT() MSX1
CSNG() MSX1
EXP() MSX1
FIX() MSX1
INT() MSX1
LOG() MSX1
RND() MSX1
SGN() MSX1
SQR() MSX1

New Basic Instructions/Machine Language Functions

Instruction Generation Updates Related extensions / Remarks
CALL or _ MSX1 Instruction for language machine experts
DEF USR MSX1
USR() MSX1 Data input function


Printer

Instruction Generation Updates Related extensions / Remarks
LLIST MSX1
LPRINT MSX1
OPEN MSX1


Programming

Instruction Generation Updates Related extensions / Remarks
 : MSX1 Separator between two instructions
AUTO MSX1
CONT MSX1
DELETE MSX1
END MSX1
FRE() MSX1
LIST MSX1
NEW MSX1
REM or ' MSX1
RENUM MSX1
RESUME MSX1
STOP MSX1
TROFF MSX1
TRON MSX1

Prompt

Instruction Generation Updates Related extensions / Remarks
SET BEEP MSX2 Related to Real Time Clock (RTC)
SET PASSWORD MSX2 Related to Real Time Clock (RTC)
SET PROMPT MSX2 Related to Real Time Clock (RTC)
SET SCREEN MSX2 Related to Real Time Clock (RTC)
SET TITLE MSX2 Related to Real Time Clock (RTC)

RAM access

Instruction Generation Updates Related extensions / Remarks
PEEK() MSX1 Data input function
POKE MSX1
VARPTR() MSX1 Data input function

Sound and Music

Instruction Generation Updates Related extensions / Remarks
BEEP MSX1 MSX2
CALL PCMPLAY MSX Turbo R Short version: _PCMPLAY
CALL PCMREC MSX Turbo R Short version: _PCMREC
PLAY MSX1 MSX-AUDIO BASIC, MSX-MUSIC BASIC
PLAY() MSX1
SOUND MSX1 Instruction for PSG experts


Sprites

Instruction Generation Updates Related extensions / Remarks
COLOR SPRITE() MSX2
COLOR SPRITE$() MSX2
ON SPRITE GOSUB MSX1
PUT SPRITE MSX1 MSX2
SPRITE MSX1
SPRITE$() MSX1

String Handling

Instruction Generation Updates Related extensions / Remarks
LEFT$() MSX1
MID$() MSX1
RIGHT$() MSX1
SPACE$() MSX1
STRING$() MSX1

Trigonometric Functions

Instruction Generation Updates Related extensions / Remarks
ATN() MSX1
COS() MSX1
SIN() MSX1
TAN() MSX1

Variables Setting

Instruction Generation Updates Related extensions / Remarks
= MSX1 Defines a variable - see LET
CLEAR MSX1
DATA MSX1
DEF DBL MSX1
DEF FN MSX1
DEF INT MSX1
DEF SNG MSX1
DEF STR MSX1
DIM MSX1
ERASE MSX1
LET MSX1 Optional instruction, can be omitted
READ MSX1
RESTORE MSX1
RUN MSX1 Disk BASIC, MemoryDisk BASIC
SWAP MSX1

Reserved Words

Instruction Generation Updates Related extensions / Remarks
CMD MSX1 Can be diverted, instruction for language machine experts
IPL MSX1 Can be diverted, instruction for language machine experts