Will

As writer of M100 CP/M I can say there currently isn't any user-friendly way of calling M100 ROM routines from CP/M. However Steve may have discovered a sneaky access in the BIOS with his extensive experience of hacking about with the M100.

It's on my to-do list, along with other improvements, so I vow to get on to this when our winter arrives, which in New Zealand is June.

Glad you're finding M100 CP/M useful

Philip Avery

On 18/03/2024 6:50 pm, Stephen Adolph wrote:
Will,
The M100 main rom supports CP/M, i suppose that is obvious.
Cpm memory space is totally separate from the M100 memory. Both the upper and lower 33k banks are RAM for cpm.  In m100 mode, you have the standard main rom in the lower 32k, and different ram in the upper 32k.

To get full control of the m100 in cpm you need to access the main rom routines.  Well, you could rewrite all the routines but why when the main rom is there.  ;)


As John mentioned since the main rom isn't directly available in cpm you need trampoline code to switch it into view so you can call routines.

I'm not near all my info so I can't recall the exact details but certainly there is a trampoline included in m100 cpm.


So the trick is to call the trampoline with a pointer to your target routine, along with register data to feed the routine.

If I can figure out the trampoline I will send a note.

Steve

On Sunday, March 17, 2024, Will Senn <[email protected]> wrote:

    Hi All,

    I've been digging into assembly language programming on the M100
    and the documentation is fragmented, to say the least and so
    progress is stilted a bit. I've made significant progress on the
    programming toolchain - CP/M is great for this. It gives a
    rational file system, ed, asm, load, ddt, a way to run the app, a
    way to display the source, listings, etc. VEDIT is available as a
    visual editor, but editing on a host and running on CP/M is
    workable and fast. I've also gotten MAC, RMAC, and LINK working
    which is nice.

    CP/M provides functions that are callable in assembly code and
    I've made good progress on how to make CP/M work for simple I/O
    and File I/O. But, the M100 has features, like the LCD, the serial
    and parallel ports, etc. that make it unique. Is the assembly
    language CP/M programmer left on their own to interface with these
    devices or are they given access to something akin to BIOS (maybe
    the ROM functions) to make it easier?

    Say that I want to place a pixel, or draw a line, or whatnot. Does
    CP/M have any machine level routines to call, or what? Can I call
    the ROM routines from CP/M? I saw some trampoline code on the
    wiki, some language saying that it was tricky to do, a pointer to
    some old docs, etc. Is that the way forward - call the main rom
    from CP/M as described in
    
https://bitchin100.com/wiki/index.php?title=Calling_the_Main_ROM_from_Option_ROM
    
<https://bitchin100.com/wiki/index.php?title=Calling_the_Main_ROM_from_Option_ROM>,
    or, is it a matter of programming the ports?

    On the one hand, my questions are simple - how do I put a pixel on
    the screen at a give location and erase it when I want to? With
    minimal fuss. On the other hand, I'm curious about how CP/M and
    the M100 coexist and what overlap exists between the two when CP/M
    is active.

    Thanks,

    Will

Reply via email to