Read in: IT ๐ฎ๐น EN ๐บ๐ธ
In this episode of the video course on the basic language of the back computer, we introduce the MSX Basic. It is a very powerful language, with many commands. In the same video, let's see how to save and upload the basic program to tape.

Don't have an MSX computer? Try the emulator!
If you don't have an MSX computer, but you want to try to program in basic with the MSX Basic, you can download it for free, looking for it on the Internet, the FMSX emulator. I know, it's not the same as you have a real MSX computer! In the video, we see the Philips VG 8020 computer in operation, but the program can be made on any MSX computer.

If you do not own the vintage computer, through the FMSX emulator, to be installed on Windows PC (there are emulators for other operating systems), you can load MSX games and programs on a modern computer!

We draw a circle, calculate area and circumference, with MSX BASIC
The program that we analyze allows you to immediately understand the enormous abilities of the EMS Basic. With very few commands, trace a circle to the monitor and calculate the area and the perimeter.

The program listing consists of just a few lines of code. In total there are only 8.

10 INPUT "R";R 20 SCREEN 2 30 CIRCLE (128,96),R 40 IF INKEY$="" THEN GOTO 40 50 SCREEN 0 60 PRINT "R=" R 70 PRINT "A=" 3.1415*R^2 80 PRINT "C=" 2*3.1415*R
We have already deepened the instructions INPUT and PRINT in the first episode of the BASIC language course.
On line 10, the computer asks for the radius of the circle and inserts it into the variable R. The number R must be an integer, greater than 0 and less than 100, otherwise the circle is not drawn, or it would be too large to be displayed on the monitor.
As an exercise, you can create a line 15, where you include a check to prevent the user from inserting a radius of less than 0 or greater than 100. To do this, you can take inspiration in the second episode of the Basic language course, studying conditional education IF... THEN.
To Riga 20, with education SCREEN 2, we enter graphic mode.

We draw a circle by:
CIRCLE (X,Y),R
The center of the circle is located at coordinates 128, 96, about halfway through the screen, both horizontally and vertically. The circle has radius R.

At line 40, the computer waits until a key is pressed on the keyboard. Inkey $ represents the key pressed on the keyboard. If you don't press anything, Inkey $ is empty, i.e. INKEY$="" (it is equal to nothing). If you press a key, Inkey $ contains the corresponding character, so INKEY$<>"" (it's different from nothing).
At line 50, we return to text mode, exiting the graphics and erasing the previously drawn circle.
From line 60 to 80, we write:
- the radius of the circle, R
- The area of โโthe circle a = pi_greco * r^2 (pi_greco * r * r)
- the circumference C = 2 * Pi * R
Pi is approximated to 3.1415.

Have you seen how powerful is the MSX basic programming language?
Saving and Loading the MSX BASIC Program to Tape
We continue the programming course on the MSX BASIC language with the saving and loading of the program on tape. There are several commands to save and load a program in BASIC on tape. We use SAVE and LOAD.
To save the program to tape:
SAVE "CAS:file_name"
Substituting file_name the name of the file we want to assign to the program.

Press simultaneously SAVE and START/LOAD on the recorder. Next, to start saving, press RETURN on the computer keyboard, after writing the command SAVE, as previously specified.
Obviously, the tape must be positioned correctly, at the location where you want to save the program.

To load a program from tape, you use the command:
LOAD "CAS:"

Before you press RETURN to start loading, make sure to place the tape at the correct position and press START/LOAD on the recorder.
If all goes well (hopefully!), first the computer finds the file and writes the name to the screen.
Then the MSX loads the program.

Interested in vintage computers? Subscribe to the YouTube channel!
Thanks for discussing MSX BASIC. I enjoyed it!
Thank you!