I’ve started writing a boot loader for my z80 system.
So far the program can accept hex via serial and load it to a location in the memory.
The problem I have though is the boot loader is at the start of memory and uses the interrupts,
How can I load a new program with out overwriting the boot loader?
(Also a loaded program might want to use the interrupts as well)
The best and most widely used approach is to split your app into a stable boot loader that is never updated, and the application that you can replace from time to time.
AFAIK, in Z80 there are just interrupt vectors and there no support for replacing them in the CPU itself. You need to have something in your hardware that will replace your memory blocks.
Othewise you need to have feature that bootloaders is not using anything in the app part during the download and block any interrupts that can call anything in the app.