RUNENT, written by Bill Sudbrink in June 2006
-------- Cyclops Projects -------
-------- Cromemco Dazzler 40th birthday page is here:Dazzler's 40! --------
RUNENT is a program to load and execute one or two ENT files
ENT files are files that contain ASCII representations
of memory contents and are usually processed by one of
the Processor Technology ROM monitor programs.
There is a large comment block at the top of the
program source which provides the details of its
operation but here is an overview:
See the memory map (below) to help understand each stage.
Stage 0: CP/M in its normal operating mode. CP/M requires addresses from 0 to 0FFH (0 to 255 decimal) as well as several K bytes of memory at the top of memory for its normal operation. The memory in between is the TPA (Transient Program Area), the memory that CP/M application programs run in. Note that most ENT file programs are not designed to run in this address range, they usually run starting at address 0 (zero).
Stage 1: RUNENT loaded by CP/M. RUNENT is a CP/M application and is designed to run in the TPA. At this stage, RUNENT checks its command line parameters and verifies that the specified file(s) is(are) present and seem(s) to have the correct format.
Stage 2: RUNENT fixes up work code address references. RUNENT has a small block of code that does the "real work". In order to work, this code needs to be moved "out of the way" meaning to the top of the TPA. RUNENT gets the address of the top of the TPA from CP/M and then changes all of the address references in the work code to reflect where the work code will "end up".
Stage 3: RUNENT copies the fixed up work code to the top of the TPA and jumps to it.
Stage 4: The work code reads the ENT file(s), loading the memory image into the TPA. Any byte that the ENT file tells us to store between 0 and 0BEFFH is actually stored between 0100H and 0BFFFH to avoid "stepping on" the memory that CP/M uses between 0 and 0FFH. This results in a "skewed" memory image. It can not run where it is because all 8080 instructions that reference memory use absolute addresses. We fix this in the final stage, once we're done reading the file(s).
Stage 5: Move the ENT file memory image and execute it. Now that we have finished reading the ENT file(s), we no longer need CP/M. The work code moves the ENT file memory image down by 0100H to the memory location that it was designed to run from. The work code sets a few registers to values that make it look like Solos/Cutter responding to an EXEC command and jumps to the starting address that was supplied in the command line parameters.
The source is here:
It can be built with the standard CP/M ASM and LOAD
I've tested it with a number of the ENT files found on
Jim Battle's Sol-20 Web Page
I welcome any comments or suggestions. I read comp.os.cpm, the classiccmp.org cctalk mailing list and the vcf-midatlantic mailing list.