I want to exchange data/programs with an external storage/computer, but how?
First, you need to have a client running on that thing - which runs from ROM at power-up. It is that client which decides how you communicate with the computer. Can be a simple hex file loader, an XMODEM receiver, a Kermit implementation, or even a full monitor program (which may or may not include an assembler/disassembler). The sky and your ROM size are the limit, basically.
As far as hardware goes, you have a UART.
But that would mean I would need to write a Kermit compatible program for my new computer, but how?
Yes, that would be one option. Although I would recommend starting with something simpler, for example Intel HEX or XMODEM.
For the practicalities, I would recommend doing the bring-up step by step:
- Find yourself a suitable emulator. Many eons ago, I toyed with emu8086. It does not emulate a full PC, but is aimed at students, comes with some IDE, and should be a good fit for what you are trying to do. Testing your ROMs in emu8086 should be your main focus until you can generate runnable ROMs. Trying to debug code which does not even run is a huge waste of time.
- Then you use NASM (or some other assembler) to write some ROM code which configures your UART and echos the input back. No interrupts. At this stage, I normally add one to the received bytes, just to make sure that my code actually runs. A plain echo can be generated by shorting Rx/Tx or the terminal program, but a +1 won't.
- If you have functional UART communication, you can write a simple loader for Intel HEX or XMODEM. Write a message to the UART, read the data until it is finished, then just run it. This does not require a lot of code, so you can write it in assembly, but see below.
- At that point, you can write more complex code, test and debug it, and turn it into better ROM code when it works.
If you are more comfortable with C, I have written an XMODEM receiver [
here]. As it is, it receives a floppy image via XMODEM and writes it to a floppy. It is written for bcc (Bruce's C compiler), which is a simple C compiler provided in Debian/Ubuntu, but also shipped with FreeDOS.
What makes it useful to you is that
it contains its own startup code and does not use any library, not even the C library. Execution starts in crt0.s, xmodem.c is fully self-contained, and uart.c is where your UART code would go.