Category Archives: How-to

Relearning MSX #35: Checking consistency of data types with FPC.COM

Posted by in How-to,MSX,Retro,Technology | November 19, 2015

Input MSX #2, page 48

In the previous post we learnt about the data types in MSX-C and how important it is to use the right one in order to keep our programs free of bugs. However, when bugs happen it’s not always easy to track them down and fix them, so it would be nice to have a tool to help with this. MSX-C’s Type Parameter Checker (FPC.COM) is such a tool. We already saw it back in chapter #14, but we talked mostly about ist command line parameters. Today we’re going to actually see how it works and use it to locate bugs in our programs.

Read more ›

Relearning MSX #34: Data types in MSX-C

Posted by in How-to,MSX,Retro,Technology | November 13, 2015


SD Mesxes #15 cover. 34!

In the previous post we learnt how to display numbers in different notations. The output was different for each numeric base (for the convenience of the user of the program), but from the computer’s point of view it didn’t make a difference: all these values were stored and handled internally in exactly the same way.

Today we’re going to look at data types. These have an impact on how numbers (and characters) are stored in the computer’s memory, and how the computer handles the data during arithmetic operations, comparisons and function calls.

What we’re going to see in this post is extremely important for coding error-free programs. Try not to skip it even if it may seem boring (I’ll try and keep things interesting). If anything isn’t clear then ask in the comments below. I’ll be happy to help.

What are data types?

Let’s start with a small experiment. Imagine that we have two numbers written in hexadecimal, 0x9000 and 0x3000. If we print these numbers in decimal we see that 0x9000 is -28672 and 0x3000 is 12288:

Read more ›

Relearning MSX #33: Numeric notations in MSX-C

Posted by in How-to,MSX,Retro,Technology,Uncategorized | November 8, 2015


In previous posts we’ve seenhow to perform operations with numbers, and we also know how to print decimal numbers on the screen.

During the next two posts we’re going to learn what numeric types MSX-C supports, how we (the programmers) can represent numbers in our programs, and how to print numbers in different notations.

Let’s dig in:

Four different notations

MSX-C understands four different numeric notations: decimal, hexadecimal, octal and character constants (remember that internally the computer sees these as a number).

Number formats in C

Number formats in C

Let’s see what they’re useful for:

Read more ›

Relearning MSX #32: Other control structures in MSX-C

Posted by in How-to,MSX,Retro,Technology | October 24, 2015

In the previous post we learnt how to create loops in our programs using the statements forwhile and do…while. Today we’re seeing the remaining control structures in C: breakgotocontinue and switch.

Let’s get to it.

Aborting the execution of a loop: the break statement

The break statement forcefully stops the execution of a loop, regardless of whether its condition passes or not. We use this when for any reason we want to exit from the loop without letting it run any more iterations.

The syntax is very simple, just enter the statement by itself followed by a semicolon:


This is a diagram of break‘s operation:

Read more ›

Relearning MSX #31: Loops in MSX-C

Posted by in How-to,MSX,Retro,Technology | October 21, 2015

In the last post we finished our look at the conditionals in MSX-C. Today we’re going to learn something much more fun: loops. As you may know already, loops are structures that run the same code again and again a specific number of times, or until a certain condition occurs. Loops are an essential part of every non-trivial program, so it’s very important that we learn what types there are and how to use them.

Let’s get to it.

Loops that repeat a given number of times: the for statement

There are several ways to implement loops in C, but the for statement is probably the most commonly used. It resembles the FOR…NEXT command in MSX-BASIC.

The syntax of a for look in C is like this:

for ( setup ; condition ; update ) statement

When a for loop runs, the first thing that happens is that the code in the setup block runs once (and only once!). After that, if condition is true then the code in the statement block is executed, followed by the code in the update block. Then the loop goes back to condition and does the same thing again and again for as long as condition is true.

Read more ›

Tecnobytes MSX Ethernet Cartridge and InterNestor Lite review (part 2)

Posted by in Gadgets,Hardware,How-to,MSX,Retro,Technology | October 18, 2015

This is the second part of this post. We continue from the point where the previous part ended: looking at the network applications developed by Konamiman.

FTP.COM: File Transfer Protocol

Yes, an FTP client for MSX! You can now connect to FTP servers on the Internet and download files directly to the MSX, without having to download them to a PC or a Mac first and then copy to the MSX via removable media.

FTP.COM is very easy to use. It accepts the standard commands to interact with FTP. You can also set the environment variables FTP_USER, FTP_PASSWORD and FTP_ACCOUNT and use these as the defaults when connecting to servers.

Typing ‘help’ at the FTP prompt will show all the available commands:

Available commands in the FTP.COM client (Click to enlarge)

Available commands in the FTP.COM client (Click to enlarge)

Read more ›

Tecnobytes MSX Ethernet Cartridge and InterNestor Lite review (part 1)

Posted by in Gadgets,Hardware,How-to,MSX,Retro,Technology | October 17, 2015

Recently I received the MSX Ethernet Cartridge from the Brazilian group Tecnobytes. This batch is already sold out, so for these of you who bought one, here’s a review of the unit and what you can do with it. The cartridge is useless without software, so I’m also explaining the InterNestor Lite TCP/IP stack and its companion suite of network applications, both developed by Néstor Soriano (Konamiman).

The review is long, so it’s split in two posts.

The hardware

This is a Konami-sized cartridge with a single Ethernet port to the right and a couple of LEDs: the amber one indicates that the cartridge is powered on, and the green one indicates that there’s an Ethernet link established. It flashes during data transmission.


Tecnobytes’ MSX Ethernet Cartridge (Click to enlarge)

The Ethernet controler is a Realtek RTL8019AS, which means that the maximum speed is 10Mbps in full-duplex. This may not sound very impressive nowadays, but it is more than enough for the MSX, as we will see later. The design is based on Daniel Berdugo’s ObsoNET board.

Read more ›

FTP server running on my FS-A1GT

Posted by in Gadgets,Hardware,How-to,MSX,Retro,Technology | October 15, 2015

Yep, my MSX turbo R at home is now connected to the Internet and acting as an FTP server. It is connected to my home network using the Tecnobytes Ethernet Cartridge and running Konamiman’s ObsoFTP server over his Internestor Lite TCP/IP stack.



Feel free to play with it if you want to do some testing. It’s serving an almost empty 32MB partition on my B: disk (a CF card).

URL: (any user name and password will work) Edit: the server is offline now, but read below for a couple of interesting updates…

Read more ›

Relearning MSX #30: Complex conditional statements in MSX-C

Posted by in How-to,MSX,Retro,Technology | October 13, 2015

In the last post we learnt how to use comparisons in C. This time we’ll see some properties of the comparison operators and also how to test on more complex conditions.

Structure of conditional statements: comparison values

Until now we’ve only seen conditional statements that use the relational operators that we saw in the previous post. However, in adition to these relational operators we can use almost anything as the condition. For example, the code below shows how to test a condition elegantly:

if() condition on MSX-C

(Click to enlarge)

In this example, whether the puts() statement will run or not depends on the value of whatever is inside the parentheses following the if keyword:

  • If the value inside the parentheses is zero, the condition is false and the puts() does not run
  • If the value inside the parentheses is anything other than zero then the condition is true and the puts() statement runs

Because of this, the code above will not do anything if the variable error contains a zero, and it will print the message “Something bad happened.” if it contains any non-zero value.

Read more ›

Relearning MSX: Roadmap

Posted by in How-to,MSX,Retro,Technology | October 12, 2015

Wow, it’s been already almost 30 posts of the Relearning MSX series. Thanks so much for your encouragement and nice comments! And especial thanks to the supporters who are making this possible.

I think this is a good time to see what’s going to come in the future posts. The remaining subjects covering MSX-C are these:

  • Loops
  • Other control structures (break, continue, case…)
  • Handling numeric values with printf()
  • How values are stored in the MSX memory
  • Formatted output with printf()
  • Screen control characters
  • Escape sequences
  • Graphical characters
  • Functions (2-3 chapters)
  • Storage classes and scope of variables
  • Pointers (2-3 chapters)
  • String arrays
  • Structured data and creating types (1-2 chapters)
  • Creating and reading files (2-3 chapters)
  • Essential library functions (3-5 chapters)

This will keep us busy for about 25-30 more chapters and the schedule is well defined already. After completing these we’ll have a pretty solid base of the C language to tackle what’s coming next: the fun stuff, the MSX-especific subjects.

In no particular order:

  • The MSX graphic modes
  • Organization of the video memory
  • Sprites
  • Game control: cursor keys, triggers, joystick, mouse
  • Interrupts
  • Slots and subslots
  • Memory mappers
  • Sound effects
  • Playing music
  • BIOS routines
  • System work area and variables
  • PCM
  • etc

All these subjects will come from the several books I have here:

  • MSX2 Technical Handbook
  • MSX turbo R Technical Handbook
  • MSX-Datapack I, II and III
  • …and others

There’s no schedule decided for these yet. We’ll talk about these subjects in the order we need them, so if there’s anything you’d like to see covered, don’t wait and just ask for it!

And now the important part: please support these posts with a small donation, because I write during my free time and sometimes other priorities take precedence. Increasing the amount of donations increases the priority of writing these articles.

Thanks for your support!