Mike_Z
Veteran Member
I'm getting to the point of relocating CP/M from the starting 20K spot to higher memory. I'm not sure whether or not I can squeeze the cold start loader and my monitor program all into 2k or not, but if necessary I'll use 4K.
Anyway, I started to think about how MOVCPM.COM works. I seem to remember that either reading or being told that MOVCPM.COM has to be part of the original package with the CPM. And since I copied the OS from someone on the internet, I'm not sure whether the copy of my MOVCPM.COM will work or not.
How does MOVCPM.COM work? To move code from one block to another block without reassembling it, would require to change the instructions that have address's with them. Some instructions in the transfer group instructions like LHLD and some of the branch group, like JMP, etc.
So as long as these instructions are referencing addresses within the code being transferred all is OK, but what about if an instruction was addressing something external to the moved code? How does MOVCPM.COM handle that?
Am I on the right track here or not. Thanks Mike
Anyway, I started to think about how MOVCPM.COM works. I seem to remember that either reading or being told that MOVCPM.COM has to be part of the original package with the CPM. And since I copied the OS from someone on the internet, I'm not sure whether the copy of my MOVCPM.COM will work or not.
How does MOVCPM.COM work? To move code from one block to another block without reassembling it, would require to change the instructions that have address's with them. Some instructions in the transfer group instructions like LHLD and some of the branch group, like JMP, etc.
So as long as these instructions are referencing addresses within the code being transferred all is OK, but what about if an instruction was addressing something external to the moved code? How does MOVCPM.COM handle that?
Am I on the right track here or not. Thanks Mike