/// <summary> /// Returns the interrupt stack pointer. ssp is used as isp. /// </summary> ULO cpuGetIspAutoMap(void) { if (cpuGetFlagSupervisor() && !cpuGetFlagMaster()) { return cpuGetAReg(7); } return cpuGetSspDirect(); }
/// <summary> /// Sets the interrupt stack pointer. ssp is used as isp. /// </summary> void cpuSetIspAutoMap(ULO new_isp) { if (cpuGetFlagSupervisor() && !cpuGetFlagMaster()) { cpuSetAReg(7, new_isp); } else { cpuSetSspDirect(new_isp); } }
ULO cpuActivateSSP(void) { ULO currentSP = cpuGetAReg(7); // check supervisor bit number (bit 13) within the system byte of the status register if (!cpuGetFlagSupervisor()) { // we are in user mode, thus save user stack pointer (USP) cpuSetUspDirect(currentSP); currentSP = cpuGetSspDirect(); if (cpuGetModelMajor() >= 2) { if (cpuGetFlagMaster()) { currentSP = cpuGetMspDirect(); } } cpuSetAReg(7, currentSP); } return currentSP; }
ULO cpuGetSspAutoMap(void) {return (cpuGetFlagSupervisor()) ? cpuGetAReg(7) : cpuGetSspDirect();}