PDA

View Full Version : Z80 Assembler for PRL output



JonB
January 3rd, 2017, 01:04 AM
Hi

What are my options for generating DRI PRL output with Z80 assembly code?

I had a look around, and I understand that LINK.COM generates a .PRL given the [OP] command line option. But LINK.COM is a DRI utility and as such I expect it doesn't support Z80 opcodes. Do I have to use RMAC/MAC (and hence, am I stuck with 8080 mnemonics)? Or is there a Z80 toolchain I can use for generating relocatable objects?

Cheers
JonB

daver2
January 3rd, 2017, 02:20 AM
I have recollections of there being a Z80.LIB file that you invoked in your source file with something like MACLIB Z80. You could then use Zillog mnemonics within your program rather than Intel ones with M80.

I found a copy on maben.homeip.net (thanks Marcus).

Dave

JonB
January 3rd, 2017, 04:10 AM
Looks like PASMO will do it (assemble Z80 on a PC, with PRL output option).

http://pasmo.speccy.org/

per
January 3rd, 2017, 06:49 AM
PASMO is great! I've used it a lot, for both bigger and smaller projects.

JonB
January 3rd, 2017, 12:07 PM
I tried it today, to create a prl. It failed, created a file with a load of nulls, then the code, which started at 100h even though I had no org set.

What options do you use? Mine were --prl and the names of the input and output files. Have I missed seed something? The documentation says it isn't good at prl output, may bbe useful for creating rsx files? But these are prls with a different extension, or so I read..

Dwight Elvey
January 3rd, 2017, 12:50 PM
According to this web page, it is suppose to be assembled at 100H.

http://www.seasip.info/Cpm/prl.html

Maybe the header is missing or something.
Dwight

Chuck(G)
January 3rd, 2017, 02:43 PM
Failing everything, you can revert to the old scheme of "assemble it twice, ORGed once at 100H, and then at 200H" and use the MP/M utility to create the PRL file. (I've mentioned this before).

per
January 3rd, 2017, 05:33 PM
Aparrently Pasmo produces output in the RSX format instead of the MP/M PRL format. This gives you a 256-byte header to the code block, and PRL-related info after the code block.

There is some info on it here:
http://www.cpm.z80.de/manuals/cpm3-pgr.pdf

Most of my coding is for CP/M 2.2 and low-level hardware, so I usually keep a memory-map include-file with equ's for library org's. All libraries are assembled separately using this file.

To link the libraries to a target program, I will have to include the resulting sym-files from assembling the libraries. The main program starts with loading all the library-binaries into RAM, whereuppon they can freely be used. This way I can move the libraries around with relatively ease during development, by just changing the equ's in the memory-map include-file and reassembling (using a batch-file or make).

JonB
January 3rd, 2017, 11:23 PM
According to this web page, it is suppose to be assembled at 100H.

http://www.seasip.info/Cpm/prl.html

Maybe the header is missing or something.
Dwight

True, but PASMO gives an error ("ERROR: PRL genration failed: out of sync") if you have an ORG directive and use the --prl argument.



Failing everything, you can revert to the old scheme of "assemble it twice, ORGed once at 100H, and then at 200H" and use the MP/M utility to create the PRL file. (I've mentioned this before).


Which MP/M util, Chuck?

JonB
January 3rd, 2017, 11:33 PM
Aparrently Pasmo produces output in the RSX format instead of the MP/M PRL format. This gives you a 256-byte header to the code block, and PRL-related info after the code block.

There is some info on it here:
http://www.cpm.z80.de/manuals/cpm3-pgr.pdf

Most of my coding is for CP/M 2.2 and low-level hardware, so I usually keep a memory-map include-file with equ's for library org's. All libraries are assembled separately using this file.

To link the libraries to a target program, I will have to include the resulting sym-files from assembling the libraries. The main program starts with loading all the library-binaries into RAM, whereuppon they can freely be used. This way I can move the libraries around with relatively ease during development, by just changing the equ's in the memory-map include-file and reassembling (using a batch-file or make).

Ah, OK. My bad. I see a 256 block of nulls at the start of the file, followed by the code at 100h. After the last byte of the code (at 220h) is what appears to be the bitmap. Cooking with gas now..!

Shame PASMO doesn't generate a .LST file, though (the debug output is similar, but not well formatted for easy reading).

Chuck(G)
January 4th, 2017, 08:57 AM
Which MP/M util, Chuck?

GENMOD generates a PRL from two .HEX files that were assembled 100H apart. You can create the .HEX files from .COM files by using the MP/M utility GENHEX. Both will run under CP/M.

I haven't looked, but I suspect that CP/M 3 has similar, if not identical, tools.

JonB
January 4th, 2017, 10:45 AM
Looks good to me, I'll try it! Thanks!

JohnElliott
January 10th, 2017, 01:17 PM
Hi

What are my options for generating DRI PRL output with Z80 assembly code?

I had a look around, and I understand that LINK.COM generates a .PRL given the [OP] command line option. But LINK.COM is a DRI utility and as such I expect it doesn't support Z80 opcodes. Do I have to use RMAC/MAC (and hence, am I stuck with 8080 mnemonics)? Or is there a Z80 toolchain I can use for generating relocatable objects?

Use Microsoft M80 to generate .REL files, and LINK.COM with [OP] to combine them to a PRL. LINK doesn't know about opcodes, so by replacing RMAC with M80 you can get relocatable Z80 code.