When you start CP/M the following 4 .bin files are loaded into memory:
Core – A bunch of core routines, for leds, disks etc
BIOS – A stub of a BIOS
BDOS – The main part of CP/M
CCP – The interface of CP/M.
The location that the files are loaded into is dictated by the cpm.cfg file. You see these values when CP/M starts:
CORE F600
BIOS F400
BDOS EA00
CCP.BIN DE00
The CORE.BIN file contains various functions for accessing the hardware, such as switching on LEDs etc.
The Disk, User and Rom LEDs are connected to the 16550 Modem Control Register port. The ports are shown in one of the Monitor screens:
16C550C UART Ports CH376S Module Ports
------------------- -------------------
TX / RX 8 Data Port 16
Interrupt Enable 9 Command Port 17
Interrup Status 10
Line Control 11
Modem Control 12
Line Status 13
Modem Status 14
Scratch 15
So, to turn on the Disk LED (for example) there is a piece of code already loaded up in the CORE that looks like this:
disk_on:
; turn disk LED on
in a, (uart_MCR)
or %00000100
out (uart_MCR), a
ret
If you want to call any of the core functions from a .com file you can include the core_jump.asm file in your program. This is just a list of all the core routines, arranged as a jump-indirection table, just to make life easier. You’ll need to include port_numbers.asm and locations.asm too, which are just some EQUs. You can then toggle the disk light by calling CORE_disk_toggle.
Would there be anyway I may get a copy of the .asm files for your .com files
beloved_wind@yahoo.com
I want to build an 8085 version of your board, so the code will need tweaking
thanks
All the source code is on github:
https://github.com/z80playground/cpm-fat
8085??? You’re a braver man than me!