I forget almost everything I ever knew about CP/M assembly language programming, so it took me a while to figure out Z-80 assembler and CP/M system calls.

Read on for more...

I chose to use the old Microsoft MASM assembler and family (m80, l80 and friends), and completely forgot everything about it. Luckily, there's plenty of information out on the net, including the original manuals in both scanned pdf, and with lots of searching, in text format. Similarly with an explanation of the CP/M system calls.

So after a little work, I got an assembler program to print out a string using system call 9. Here is the program:

I>type hello.mac

.Z80
title Hello World

;
; A simple program to print out a string
; Tom Manos, 5/25/2009
;

;System call vector
system equ 5

;Write string call
prstrn equ 9

start: ld de,strn
ld c,prstrn
call system
ret ;back to cp/m
strn: db "Hello, world!"
db "$"
end start

I also put together the Microsoft MASM manual and the CP/M system call list into a book and had Lulu print it up for me. I should get it in a week or so.

I also uploaded it to the Documents section of this group.

I'll be having fun doing some assembler programming and you can too whether you have a real CP/M machine or use Simh.