亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pc.c

?? The uC OS-II port for Keil C V6.20, V6.21 or higher
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
*********************************************************************************************************
*                                          PC SUPPORT FUNCTIONS
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
* File : PC.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#include "includes.h"
#include "os_kcdef.h"
#include "pc.h"

/*
PC display by KC51 emulation
*/

#define interrupt
#define far	xdata
#define MK_FP(s, o)		((INT8U xdata *)(INT16U)(o))
#define getvect(vect)	((vect=vect),((void*)NULL))
#define setvect(vect, isr)	(vect=vect, isr=isr)
int OSTickDOSCtr;

const char code * const code ExitNotice[]=
{
	"Exit program",
	"Program has terminated",
	"Reset the processor to restart the program"
};

bit kbhit() KCREENTRANT;
INT8U getch() KCREENTRANT;

void exit(INT8U ec) KCREENTRANT
{
	static char str[64];
#if OS_CRITICAL_METHOD == 3
    OS_CPU_SR cpu_sr;
#endif

    OS_ENTER_CRITICAL();
	for(;;)
	{
		INT8U i;

		for(i=0; i<sizeof(ExitNotice)/sizeof(ExitNotice[0]); i++)
		{
			PC_DispStr (0, 8+i, ExitNotice[i], DISP_FGND_WHITE + DISP_BGND_BLACK);
		}
		sprintf(str, "Exit code = %bd", ec);
		PC_DispStr (0, 24, str, DISP_FGND_WHITE + DISP_BGND_BLACK);
		while(! kbhit());
		getch();
		TR0=0;
		ET0=0;
		((void(*)(void))0)();
	}

	OS_EXIT_CRITICAL();
}
/*
INT8U inp(INT8U p)
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x1000+p);
	return * pscr;
}
*/
void outp(INT8U p, INT8U d)
{
    INT8U  far *pscr;
    pscr	= MK_FP(DISP_BASE, 0x1000+p);
	*pscr	= d;
}

struct time
{
	INT8U ti_hour, ti_min, ti_sec;
};

struct date
{
	INT8U da_year, da_mon, da_day;
};

void gettime(struct time * pti) KCREENTRANT
{
    INT8U  far *pscr;
    pscr			= MK_FP(DISP_BASE, 0x2010);
	pti->ti_hour	=* pscr ++;
	pti->ti_min		=* pscr ++;
	pti->ti_sec		=* pscr;
}

void getdate(struct date * pdt) KCREENTRANT
{
    INT8U  far *pscr;
    pscr			= MK_FP(DISP_BASE, 0x2020);
	pdt->da_year	= * pscr ++;
	pdt->da_mon		= * pscr ++;
	pdt->da_day		= * pscr;
}

/*
INT8U random(INT8U seed) KCREENTRANT
{
	INT8U xdata * p;
	p=MK_FP(0, 0x2032);
	return ((*p)^((INT16U) rand())) % (INT16U)seed;
}
*/

INT8U random(INT8U seed) KCREENTRANT
{
    INT8U i;
	i=(((INT16U) rand())^((INT16U) rand())+TL0) % (INT16U)seed;
	return i;
}

bit kbhit() KCREENTRANT
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x2030);
	return *pscr;
}

INT8U getch() KCREENTRANT
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x2031);
	return *pscr;
}

/*
*********************************************************************************************************
*                                               CONSTANTS
*********************************************************************************************************
*/
#define  DISP_BASE                  0xB800       /* Base segment of display (0xB800=VGA, 0xB000=Mono)  */
#define  DISP_MAX_X                     80       /* Maximum number of columns                          */
#define  DISP_MAX_Y                     25       /* Maximum number of rows                             */

#define  TICK_T0_8254_CWR             0x43       /* 8254 PIT Control Word Register address.            */
#define  TICK_T0_8254_CTR0            0x40       /* 8254 PIT Timer 0 Register address.                 */
#define  TICK_T0_8254_CTR1            0x41       /* 8254 PIT Timer 1 Register address.                 */
#define  TICK_T0_8254_CTR2            0x42       /* 8254 PIT Timer 2 Register address.                 */

#define  TICK_T0_8254_CTR0_MODE3      0x36       /* 8254 PIT Binary Mode 3 for Counter 0 control word. */
#define  TICK_T0_8254_CTR2_MODE0      0xB0       /* 8254 PIT Binary Mode 0 for Counter 2 control word. */
#define  TICK_T0_8254_CTR2_LATCH      0x80       /* 8254 PIT Latch command control word                */

#define  VECT_TICK                    0x08       /* Vector number for 82C54 timer tick                 */
#define  VECT_DOS_CHAIN               0x81       /* Vector number used to chain DOS                    */

/*
*********************************************************************************************************
*                                       LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/
             
static INT16U    PC_ElapsedOverhead;
static jmp_buf   PC_JumpBuf;
static BOOLEAN   PC_ExitFlag;
void           (*PC_TickISR)(void);

/*$PAGE*/
/*
*********************************************************************************************************
*                                              CLEAR SCREEN
*
* Description : This function clears the PC's screen by directly accessing video RAM instead of using
*               the BIOS.  It assumed that the video adapter is VGA compatible.  Video RAM starts at
*               absolute address 0x000B8000.  Each character on the screen is composed of two bytes:
*               the ASCII character to appear on the screen followed by a video attribute.  An attribute
*               of 0x07 displays the character in WHITE with a black background.
*
* Arguments   : color   specifies the foreground/background color combination to use 
*                       (see PC.H for available choices)
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispClrScr (INT8U color) KCREENTRANT
{
    INT8U  far *pscr;
    INT16U      i;


    pscr = MK_FP(DISP_BASE, 0x0000);
    for (i = 0; i < (DISP_MAX_X * DISP_MAX_Y); i++) { /* PC display has 80 columns and 25 lines        */
        *pscr++ = ' ';                                /* Put ' ' character in video RAM                */
        *pscr++ = color;                              /* Put video attribute in video RAM              */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             CLEAR A LINE
*
* Description : This function clears one of the 25 lines on the PC's screen by directly accessing video 
*               RAM instead of using the BIOS.  It assumed that the video adapter is VGA compatible.  
*               Video RAM starts at absolute address 0x000B8000.  Each character on the screen is 
*               composed of two bytes: the ASCII character to appear on the screen followed by a video 
*               attribute.  An attribute of 0x07 displays the character in WHITE with a black background.
*
* Arguments   : y            corresponds to the desired line to clear.  Valid line numbers are from 
*                            0 to 24.  Line 0 corresponds to the topmost line.
*
*               color        specifies the foreground/background color combination to use 
*                            (see PC.H for available choices)
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispClrLine (INT8U y, INT8U color) KCREENTRANT
{
    INT8U far *pscr;
    INT8U      i;


    pscr = MK_FP(DISP_BASE, (INT16U)y * DISP_MAX_X * 2);
    for (i = 0; i < DISP_MAX_X; i++) {
        *pscr++ = ' ';                           /* Put ' ' character in video RAM                     */
        *pscr++ = color;                         /* Put video attribute in video RAM                   */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                           DISPLAY A SINGLE CHARACTER AT 'X' & 'Y' COORDINATE
*
* Description : This function writes a single character anywhere on the PC's screen.  This function
*               writes directly to video RAM instead of using the BIOS for speed reasons.  It assumed 
*               that the video adapter is VGA compatible.  Video RAM starts at absolute address 
*               0x000B8000.  Each character on the screen is composed of two bytes: the ASCII character 
*               to appear on the screen followed by a video attribute.  An attribute of 0x07 displays 
*               the character in WHITE with a black background.
*
* Arguments   : x      corresponds to the desired column on the screen.  Valid columns numbers are from
*                      0 to 79.  Column 0 corresponds to the leftmost column.
*               y      corresponds to the desired row on the screen.  Valid row numbers are from 0 to 24.
*                      Line 0 corresponds to the topmost row.
*               c      Is the ASCII character to display.  You can also specify a character with a 
*                      numeric value higher than 128.  In this case, special character based graphics
*                      will be displayed.
*               color  specifies the foreground/background color to use (see PC.H for available choices)
*                      and whether the character will blink or not.
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispChar (INT8U x, INT8U y, INT8U cc, INT8U color) KCREENTRANT
{
    INT8U  far *pscr;
    INT16U      offset;


    offset  = (INT16U)y * DISP_MAX_X * 2 + (INT16U)x * 2;  /* Calculate position on the screen         */
    pscr    = MK_FP(DISP_BASE, offset);
    *pscr++ = cc;                                           /* Put character in video RAM               */
    *pscr   = color;                                       /* Put video attribute in video RAM         */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                 DISPLAY A STRING  AT 'X' & 'Y' COORDINATE
*
* Description : This function writes an ASCII string anywhere on the PC's screen.  This function writes
*               directly to video RAM instead of using the BIOS for speed reasons.  It assumed that the 
*               video adapter is VGA compatible.  Video RAM starts at absolute address 0x000B8000.  Each 
*               character on the screen is composed of two bytes: the ASCII character to appear on the 
*               screen followed by a video attribute.  An attribute of 0x07 displays the character in 
*               WHITE with a black background.
*
* Arguments   : x      corresponds to the desired column on the screen.  Valid columns numbers are from
*                      0 to 79.  Column 0 corresponds to the leftmost column.
*               y      corresponds to the desired row on the screen.  Valid row numbers are from 0 to 24.
*                      Line 0 corresponds to the topmost row.
*               s      Is the ASCII string to display.  You can also specify a string containing 
*                      characters with numeric values higher than 128.  In this case, special character 
*                      based graphics will be displayed.
*               color  specifies the foreground/background color to use (see PC.H for available choices)
*                      and whether the characters will blink or not.
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispStr (INT8U x, INT8U y, INT8U *s, INT8U color) KCREENTRANT
{
    INT8U  far *pscr;
    INT16U      offset;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产一区二区| 色综合天天综合| 96av麻豆蜜桃一区二区| 日韩免费成人网| 亚洲国产成人va在线观看天堂| 韩国三级中文字幕hd久久精品| 在线视频一区二区三区| 国产精品久久久爽爽爽麻豆色哟哟| 日韩av电影免费观看高清完整版在线观看 | 日日嗨av一区二区三区四区| 波多野结衣在线aⅴ中文字幕不卡| 日韩欧美激情在线| 日韩精品免费视频人成| 色狠狠一区二区| 成人欧美一区二区三区黑人麻豆| 国产做a爰片久久毛片 | 欧美亚洲另类激情小说| 中文字幕亚洲欧美在线不卡| 国产精品自拍毛片| 久久精品一区二区三区不卡牛牛| 久久国产精品第一页| 欧美男人的天堂一二区| 一区二区三区在线视频免费观看| 成人av网站大全| 国产精品久久三区| 99久久夜色精品国产网站| 国产精品欧美一区二区三区| 成人看片黄a免费看在线| 久久精品一区二区三区av | 狠狠久久亚洲欧美| 欧美xxxxx裸体时装秀| 美国欧美日韩国产在线播放| 日韩亚洲欧美在线观看| 久久国产精品色| 精品久久久久久无| 国产伦精品一区二区三区在线观看| 日韩精品专区在线影院观看| 久久99精品国产.久久久久| 日韩一区二区在线观看视频播放| 麻豆一区二区三区| 久久久精品国产99久久精品芒果 | 国产精品乱码一区二三区小蝌蚪| 国产精品亚洲一区二区三区妖精| 国产日韩v精品一区二区| av成人老司机| 亚洲亚洲精品在线观看| 日韩午夜中文字幕| 国产精品一卡二卡在线观看| 亚洲欧美在线视频| 欧美色区777第一页| 日本特黄久久久高潮| 精品久久久久av影院| 粉嫩一区二区三区性色av| 亚洲黄色免费网站| 日韩免费性生活视频播放| 国产精品一区免费在线观看| 一区二区三区中文免费| 日韩午夜av电影| 91在线观看下载| 视频一区在线视频| 国产欧美久久久精品影院| 99久久精品国产麻豆演员表| 天堂在线一区二区| 国产精品欧美精品| 欧美日韩国产一级片| 国产超碰在线一区| 亚洲图片欧美一区| 亚洲国产电影在线观看| 欧美日韩国产高清一区二区三区 | 中文字幕精品在线不卡| 欧美日韩国产乱码电影| 成人看片黄a免费看在线| 免费观看30秒视频久久| 亚洲精品高清在线观看| 亚洲精品在线网站| 欧美性猛交一区二区三区精品| 国产风韵犹存在线视精品| 午夜在线成人av| 国产精品看片你懂得| 欧美一区二区人人喊爽| 91成人免费网站| 国产xxx精品视频大全| 蜜桃一区二区三区在线观看| 亚洲免费观看高清在线观看| 久久久久久一级片| 精品免费国产二区三区 | 亚洲色图一区二区三区| 日韩免费成人网| 欧美精品aⅴ在线视频| 成人小视频在线观看| 激情综合五月天| 日韩成人精品在线观看| 亚洲成人动漫精品| 亚洲伦在线观看| 亚洲欧洲精品一区二区三区不卡| 26uuu精品一区二区| 欧美一区二区视频免费观看| 在线免费观看不卡av| 99麻豆久久久国产精品免费优播| 国内精品在线播放| 蜜臀av国产精品久久久久| 日韩精品福利网| 亚洲成人在线免费| 亚洲成人激情综合网| 亚洲一区二区三区四区五区中文| 国产精品灌醉下药二区| 国产精品美女久久久久aⅴ| 久久理论电影网| 精品国产成人在线影院| 精品国产精品一区二区夜夜嗨| 欧美一级午夜免费电影| 在线成人高清不卡| 91麻豆精品91久久久久同性| 欧美久久久久久久久中文字幕| 精品视频一区二区不卡| 欧美日韩精品一区视频| 7777精品伊人久久久大香线蕉完整版 | 波多野结衣中文字幕一区二区三区| 国内外成人在线视频| 国产一区二区三区精品欧美日韩一区二区三区 | 中文字幕免费观看一区| 久久久五月婷婷| 欧美国产乱子伦| 亚洲色图第一区| 亚洲444eee在线观看| 视频一区欧美精品| 精品一区中文字幕| 国产成人综合精品三级| 色婷婷综合激情| 欧美疯狂性受xxxxx喷水图片| 欧美成人艳星乳罩| 国产精品久久久久天堂| 一区二区在线观看免费视频播放| 亚洲五月六月丁香激情| 久久国产精品一区二区| 成人免费高清在线| 欧美日韩极品在线观看一区| 精品国产一区二区三区不卡| 国产精品天天看| 亚洲超碰97人人做人人爱| 蜜桃精品在线观看| 成人黄色av电影| 7777精品伊人久久久大香线蕉超级流畅 | 成人午夜伦理影院| 色综合久久88色综合天天免费| 8v天堂国产在线一区二区| 国产丝袜美腿一区二区三区| 夜夜嗨av一区二区三区| 国产一区二区精品久久99| 一道本成人在线| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产麻豆精品久久一二三| 91视频观看视频| 精品国产一区久久| 亚洲一区二区三区四区在线 | 精品一区二区三区在线观看 | 精品国产一区二区三区不卡| 亚洲欧美日本韩国| 国产一区不卡精品| 91久久精品午夜一区二区| 2023国产精品| 五月综合激情日本mⅴ| 国产成人av电影在线播放| 欧美日韩国产一区| 亚洲欧美一区二区在线观看| 久久99精品国产麻豆婷婷洗澡| 色国产精品一区在线观看| 久久久亚洲高清| 麻豆免费看一区二区三区| 色婷婷av一区| 国产精品午夜在线| 国产一区二区三区在线观看免费视频 | 日产欧产美韩系列久久99| 99久久精品免费精品国产| 国产日韩精品一区| 国产一区二区调教| 日韩免费看的电影| 日韩精品视频网| 欧美人牲a欧美精品| 一区二区三区四区高清精品免费观看| 国产夫妻精品视频| 久久天天做天天爱综合色| 日韩激情中文字幕| 在线观看日韩精品| 亚洲综合男人的天堂| 色偷偷88欧美精品久久久| 亚洲人成精品久久久久| 国产a视频精品免费观看| 久久综合久久综合久久| 麻豆一区二区三区| 日韩欧美成人一区二区| 蜜臀av性久久久久蜜臀aⅴ| 欧美一区二区三区色| 日韩一区精品字幕| 欧美日韩综合一区| 天涯成人国产亚洲精品一区av| 精品视频在线免费看| 婷婷久久综合九色综合绿巨人| 欧美日韩在线综合| 日韩av在线免费观看不卡|