MSX

Starting Msx Assembly 4

Published at October 22, 2020 ·  9 min read

So lets start where we ended in part 3. We had a piece of code which printed a letter, one by one, to the screen to finally print “Hello world”.

Execute:
        LD HL, HELLO

LOOP:   LD A, (HL)
        CP 0
        RET Z
        CALL CHPUT
        INC HL
        JP LOOP	
HELLO:  db "Hello world",0

First we point register pair HL to the label HELLO. On that label we define a set of bytes (db) in memory, “Hello world”. Effectively, HL now contains the memory adress of the capital H. INC HL will increase HL so it will point to the next byte in memory, containing the letter e. Now what will happen if we use INC (HL) instead?

...

» Read more

Starting MSX Assembly part 3

Published at June 1, 2019 ·  8 min read

So we’ve seen how we can call the BIOS and how to use an assembler to create a file which can be BLOAD’ed and run on an (emulated) MSX. So now that is out of the way, lets do the mother of all tutorials: Hello world!

This can be pretty hard to start with if you want to do this in screen 2 of the MSX. But let’s do this in screen 0 because then we can get some help from the BIOS. The BIOS has a nice call that can display a character on the screen called CHPUT. There are a lot of resources which list all the BIOS calls, e.g. http://map.grauw.nl/resources/msxbios.php , so of you want to get an overview of all the BIOS calls, start reading those ;)

...

» Read more

Starting MSX assembly part 2

Published at May 11, 2019 ·  2 min read

So, in the previous post we started with a small assembly program to produce a beep:

    db $FE     ; magic number
    dw Begin    ; begin address of the program
    dw End - 1  ; end address of the program
    dw Execute  ; program execution address (for ,R option)

    org $C000   ; The program start at C000h in the MSX's RAM
Begin:
Execute:
    CALL $C0  ; Call the BEEP bios routine
    ret
End:

What I did not talk about was how to actually use an assembler to create an actual file which the MSX can execute. So let’s do that now.

...

» Read more

Starting MSX assembly part 1

Published at May 5, 2019 ·  4 min read

I somehow get the feeling every now and then that more people want to know how to program things for old computers. Since I still have a working MSX and still sometimes program for it, let’s see if I can create some tutorials.

Assembler

The MSX has a Z80 processor on board. So you need a Z80 assembler if you want to program in assembly. You can use an assembler on the MSX like Wbass-2 or Compass, or you can use a PC or Mac for cross-development and use something like Sjasm or Glass. For now I wont be covering how to use an assembler. Instead I’ll focus on assembly and the MSX bios at first.

...

» Read more