📄 psp.c
字号:
/* PSP.C */
#include <stdlib.h>
#include <dos.h>
#include "tsr.h"
#define GET_PSP_DOS2 0x51
#define GET_PSP_DOS3 0x62
#define SET_PSP 0x50
static union REGS regs;
/*****
Function: GetPSP - returns current PSP
*****/
unsigned GetPSP(void)
{
if (_osmajor == 2)
{
if (! crit_err_ptr) /* must not have called InitInDos */
return 0;
*crit_err_ptr = 0xFF; /* force use of proper stack */
regs.h.ah = GET_PSP_DOS2;
intdos(®s,®s);
*crit_err_ptr = 0;
}
else
{
regs.h.ah = GET_PSP_DOS3;
intdos(®s,®s);
}
return regs.x.bx;
}
/*****
Function: SetPSP - sets current PSP
*****/
void SetPSP(unsigned segPSP)
{
if (!crit_err_ptr) /* must not have called InitInDos */
return;
*crit_err_ptr = 0xFF; /* force use of correct stack */
regs.h.ah = SET_PSP;
regs.x.bx = segPSP; /* pass segment value to set */
intdos(®s,®s);
*crit_err_ptr = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -