📄 dosboot.c
字号:
/* reboot.c
DOS reboot program.
The program below works in TurboC (or MS C). In some compilers, you
have to fold the address to 20 bits, but here the segment and offset
are separate.
*/
#define MAGIC 0 /* for cold restart */
/* #define MAGIC 0x1234 /* for warm restart */
#define BOOT_SEG 0xffffL
#define BOOT_OFF 0x0000L
#define BOOT_ADR ((BOOT_SEG << 16) | BOOT_OFF)
#define DOS_SEG 0x0040L
#define RESET_FLAG 0x0072L
#define RESET_ADR ((DOS_SEG << 16) | RESET_FLAG)
// delete warning for no prototype...
#pragma warn -pro
void dosboot( void )
{
void ((far *fp)()) = (void (far *)()) BOOT_ADR;
*(int far *)RESET_ADR = MAGIC;
(*fp)();
// return 0; /* never gets here, but keeps compiler happy */
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -