• Please review our updated Terms and Rules here

Mac-80 and friends under CP/M 2.2

pitlog

Member
Joined
Jun 11, 2008
Messages
47
Location
Hampton Roads, VA
Hi;

I'm running CP/M under altair-z80 on a raspberry pi zero-w, accessed via putty. It runs great, and I have a very large collection of software.

I'm in the process of building a BDOS library using Mac-80, Link-80 and Lib-80 and keep getting an "undefined global" error when linking against the still very small library. I have a set of printed docs (from the Fortran distribution) and have read them carefully to no avail. These are reference docs, though, and don't provide any working examples of what I'm trying to do. I am declaring the library calls "external" in the main program and "global" in the library source.

Have any of you seen a tutorial on how to use this stuff, or just examples of building and using a library?

Happy to upload my small programs and the commands I'm using to assemble, build the library, and link if I have to.

Cheers,
Tom
 
Assuming these are the DRI utils (MAC.COM, et al. and not MicroSoft M-80 or another), I seem to recall some issues with the ordering of elements in the library and searching them, and also there may have been issues with modules in a library that referenced symbols in other modules that precede it. I have the set of manuals for CP/M Plus, which include much more detail on MAC and RMAC, LINK, and LIB. I don't have the ability to scan them, but can at least look for issues in them. One thing that I recall as being important was to add the "" after the library name in the LINK command line. You also may need to convert the library to IRL format so that more complicated searching can be done.

What symbols are being called out as undefined? Symbols from your program? or symbols from the library?
 
Another thing to keep in mind is that external/public symbol names are only significant to 6 characters. You may get some unexpected results if your symbols are not unique in the first 6 characters.
 
Thanks very much for the replies.

1. I am actually using the Microsoft Mac-80, Link-80 and Lib-80 as supplied in all the M$ high-level language packages. Maybe I should be using DRI stuff? I've never used it.

2. All my labels are 5 characters.

3. The undefined is the only library call I am making. So it's declared external in the library, but apparently not found. When I do a "lib-80 bdoslib/l", the offending call is listed just fine.

This is driving me nuts. I just know it's something simple, but haven't been able to find it.

Tom
 
Unfortunately, I'm not very familiar with the MicroSoft tools. I'm not suggesting you use the DRI ones, but that's what I'm familiar with. I see that LINK-80 does have a "/S" switch, same as the DRI "" option, for specifically saying to search a library, although simple linking should have also satisfied the symbol. I don't have documentation on LIB-80, so will have to hunt for that.

If you can post some simple code to reproduce the problem, and show the commands you are using to build, create libraries, and link, it might help. I can try some things out, and examine the REL files for possible causes. It's also possible there could be a bug in your version of the Microsoft tools, so also post a log of your build session, if possible.
 
I think it would be best if you can post a simple example with all of your commands demonstrating the problem.
 
Back
Top