|
If I were to load two hefty programs in the ROM in different register ranges, say 1-500 and 1000-1500, then add two new registers S and L. Could I use these to switch at any times between these two programs?
S can be used to store the D register value of the last program when I switch, and L can be used to store the value of program counter where the last program was left off. Then I can introduce a switch button very much like the load button to switch between these programs. (The A register and L register can be mux'd)
Since the program counter of the switched from program will be stored in the L register, I only need to find out what program memory register to switch to for the first switch. (Since I'll always know what line of the other program to go back to once I've started switching) this can be resolved by having a small program in the beginning of the ROM that finds out the base address of the second program, putting the first program right below it, and that's it.
This is really not a concrete idea in my head so I apologise for any confusing language.
|