Possibly OT: Z80/CP/M programming

From: acme_at_ao.net <(acme_at_ao.net)>
Date: Sun Jan 26 13:22:00 2003

Greetings --

I have a small program (about 3K lines of C) which I want to rewrite in Z80
assembly language in order to reduce the code size. The target system is a
Kaypro 10, 64KB RAM, CP/M 2.2. In its C incarnation, the program *will* run
but frequently runs out of system memory. The program is designed around
multiple dynamically allocated linked lists which expand and contract as the
(interactive) program is used.

I've done little Z80 assembly programming (a number of small utilities, all of
which were < 500 lines of code) but I've already written and tested *almost*
all the low-level functions (console, file, & printer i/o) which the program
requires. Except . . . how do I dynamically allocate memory? I don't see a
CP/M function call to allocate or free memory. Does such a function exist,
and if so, what are the details?

Lacking such a CP/M function, how do I write replacements for malloc() and
free()? It has to be possible or the calls would not exist in the library of
the compiler I used to build the C program.

TIA for any hints --

Received on Sun Jan 26 2003 - 13:22:00 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:36:03 BST