Below you will find pages that utilize the taxonomy term “MSX Assembly 101”
Posts
Msx Assembly 101: 08 Using z88dk
Recently I found z88dk, “the C and assembler development kit that comes ready out-of-the-box to create programs for over 100 z80-family (8080, 8085, gbz80, z80, z180, ez80_z80, KC160, Rabbit 2000, 3000, 4000, 5000) machines”. Given that z88dk can create binaries for AgonLight computer which I have now (albeit only in Z80 mode with 64k of memory accessible), I naturally got interested.
First attempt Let us take the following assembler file zfirst.
read more
Posts
Msx Assembly 101: 07 Stack, part 2
In this instalment of MSX Assembly 101 series we talk a bit more about stack.
Without a doubt, you have noticed that Z80 CPU allows pushing on the stack (and popping from the stack) only pairs of registers (af, bc, de, hl) or 16-bit index registers ix and iy. Implicitly call commands push pc on the stack, and jump and return commands pop pc. It all means that we always put two bytes on stack (or read them from the stack).
read more
Posts
Msx Assembly 101: 06 Printd
This is the next installment in my MSX Assembly 101 series. We are going to develop here printd routine, which will print the decimal value of the byte is the accumulator.
Comparing to printh (hexadecimal representation) there is an additional complication: hexadecimal representation always contains two digits (for example, the byte 0x01 is printed as 01, with leading zero); the number of digits in the decimal representation depends on the value of the number:
read more
Posts
Msx Assembly 101: 05 Printh
This is another post in the series about Z80 assembly (on MSX).
Previous posts:
Introduction Printz Using YAZE Stack In this post I will describe a creation of routine printh which will print hexadecimal representation of a byte in the accumulator register a.
Setup I am going to make the code which can be compiled both as a cartridge and as a CP/M com file. The setup for this is described in the post Using YAZE and expaned in post Stack.
read more
Posts
Msx Assembly 101: 04 Stack
Stack in cartridges According to MSX Technical Handbook, a cartridge software should initialize stack pointer before using the stack. The common practice is to put 0xF380 into sp register (see this) and remember that stack grows downwards.
It means that any cartridge program, which uses the stack, should near its beginning do something like ld sp, 0f380h.
Stack in CP/M programs When a CP/M program starts execution, sp points to the stack of 16 bytes.
read more
Posts
Msx Assembly 101: 03 Using YAZE
Recently I found myself spending days (it will be one month with two weeks break in the middle) in a place, where I have an internet connection but not a computer. I do have an iPad with a keyboard, though, and it has SSH- and VNC-clients. Unfortunately, there are too many hops to home and too many hoops to jump (including port-forwarding over reverse SSH tunnel) to use VNC comfortably. This means that I cannot use MSX emulators.
read more
Posts
MSX Assembly 101: 02 Printz
This post will continue my MSX Assembly 101 series, started here.
We are going to develop the routine printz for displaying to the screen 0-terminated strings.
Control flow Z80 CPU supports two types of jumps: jr and jp. There are also two commands for working with subroutines: call to call a subroutine and ret to return from it. Each of these command can take a condition, making control flow transition conditional on some flag.
read more
Posts
MSX Assembly 101: 01 Introduction
This is hopefully the first post in a series devoted to assembly programming for MSX computers.
A little bit of history Yamaha MSX computer (from Wikipedia) When I was a schoolboy (and now I am over 50) we had Yamaha computers in school. They were implementing MSX standard and had Zilog Z80 CPU. Recently I have got interested in retrocomputing, and, while I do not have older hardware, there are multiple emulators, and I can even run MSX emulator on my Android TV (which has Bluetooth keyboard connected to it).
read more