Recent 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.asm
:
CHPUT equ 00A2h
ld a,'A'
call CHPUT
Compiling it with zcc +msx -subtype=rom2 -o zfirst.rom zfirst.asm
yields an
error about undefined symbol _main
. Of course, z88dk links the executable
with crt0
which expects (as it would happen with C program) that the entry
point _main
is defined.
Now I Have Agon Light
So, given my interest in retrocomputing, I have bought myself Agon Light computer, AgonLight2 version.
What is it?
It is actually modern “old” computer, having 512 kilobytes of memory and eZ80 CPU. The CPU has two modes:
- one is fully compatible with classic Z80 CPU (8-bit, 64 kilobytes of addressable RAM)
- one is slight extension of it (24-bit, and this is not a typo)
There is also ESP chip which handles keyboard, graphics, and audio.
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: