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

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

?? pc.c

?? 在Keil C環境下運行的uCOS-
?? 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 "pc.h"
#include "os_kc51.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];

    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();
		((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
{
	return (((INT16U) rand())^((INT16U) rand())+TL0) % (INT16U)seed;
}

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 c, 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++ = c;                                           /* 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
*********************************************************************************************************
*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲欧美中文三级| 综合亚洲深深色噜噜狠狠网站| 国产欧美一区二区精品仙草咪| 亚洲国产视频a| 成人黄页毛片网站| 精品久久久久av影院| 亚洲一本大道在线| 99免费精品视频| 久久久久久久电影| 久久电影网站中文字幕| 欧美日韩另类一区| 亚洲欧美另类小说视频| 成人精品视频.| 久久久精品免费网站| 三级欧美韩日大片在线看| 色婷婷亚洲精品| 成人免费小视频| av在线不卡电影| 国产精品嫩草99a| 国产精品1区二区.| 国产亚洲成aⅴ人片在线观看| 免费成人av资源网| 欧美一区二区三区色| 天天色图综合网| 欧美调教femdomvk| 亚洲午夜在线电影| 欧洲一区二区三区在线| 洋洋成人永久网站入口| 在线看一区二区| 亚洲欧美一区二区三区极速播放 | 久久天堂av综合合色蜜桃网| 琪琪一区二区三区| 欧美成人a视频| 欧美午夜免费电影| 亚洲国产欧美日韩另类综合| 欧美日韩国产片| 亚洲成人动漫在线免费观看| 欧美日韩一卡二卡三卡| 五月婷婷色综合| 欧美成人福利视频| 国产成人精品影视| 中文字幕一区二区视频| 色综合中文字幕国产| 亚洲国产综合91精品麻豆| 欧美日韩成人综合天天影院| 日韩影院在线观看| 26uuu成人网一区二区三区| 国产成人免费在线观看| 最新欧美精品一区二区三区| 91国偷自产一区二区三区成为亚洲经典 | 欧美亚洲动漫制服丝袜| 日韩精品色哟哟| 久久久亚洲高清| 色综合亚洲欧洲| 蜜臀va亚洲va欧美va天堂| 亚洲精品一区二区三区香蕉| 成人美女视频在线观看| 一区二区三区四区中文字幕| 日韩欧美一级特黄在线播放| 成人午夜激情影院| 亚洲地区一二三色| 久久久综合精品| 欧美曰成人黄网| 久久电影网站中文字幕| 亚洲欧美区自拍先锋| 日韩午夜激情免费电影| 94色蜜桃网一区二区三区| 亚洲bt欧美bt精品| 国产欧美综合色| 欧美日韩精品一区二区三区 | 欧美性大战xxxxx久久久| 久久精品国产一区二区三区免费看| 国产精品色婷婷久久58| 51精品久久久久久久蜜臀| 成人少妇影院yyyy| 日av在线不卡| 亚洲免费av高清| 日本一区二区三区四区在线视频 | 欧美性一二三区| 国产成人免费视频网站高清观看视频| 一区二区三区四区视频精品免费| 精品人在线二区三区| 欧美日韩精品久久久| 99久久99久久综合| 国产呦萝稀缺另类资源| 日本不卡一二三| 夜夜精品视频一区二区| 中文字幕一区在线观看| 久久蜜桃av一区二区天堂| 日韩理论电影院| 久久先锋影音av鲁色资源| 在线成人av影院| 色婷婷av一区二区三区gif| 国产a区久久久| 激情六月婷婷综合| 免费成人在线网站| 日韩中文字幕91| 一区二区日韩av| 亚洲日本一区二区三区| 国产精品入口麻豆九色| 日韩视频在线永久播放| 欧美一二三区精品| 欧美人体做爰大胆视频| 欧美色综合久久| 日本精品一级二级| 一本一道综合狠狠老| 91在线观看污| av爱爱亚洲一区| 99热在这里有精品免费| 97久久超碰国产精品| 成年人午夜久久久| 97国产精品videossex| 不卡一区二区三区四区| 91污在线观看| 日本伦理一区二区| 欧美午夜精品久久久久久超碰| 欧美亚洲一区二区在线| 欧美吻胸吃奶大尺度电影 | 久久久久97国产精华液好用吗| 欧美大黄免费观看| 欧美精品一区二区三区久久久| 精品噜噜噜噜久久久久久久久试看| 精品免费一区二区三区| 久久久久97国产精华液好用吗| 欧美国产日韩精品免费观看| 自拍偷在线精品自拍偷无码专区| 亚洲另类中文字| 亚洲成av人片| 久久黄色级2电影| 国产成人一级电影| 色国产综合视频| 欧美一区二区三区男人的天堂| 精品国产乱码久久久久久牛牛| 久久精品人人爽人人爽| 亚洲人成精品久久久久| 日韩成人一级大片| 国产91露脸合集magnet| 欧美亚洲综合在线| 在线播放中文字幕一区| 久久久综合网站| 亚洲精品免费在线| 麻豆精品国产91久久久久久| 成人午夜视频免费看| 欧美天堂亚洲电影院在线播放 | 欧美日韩不卡一区| 精品成人一区二区| 亚洲欧洲国产专区| 麻豆国产精品官网| 94色蜜桃网一区二区三区| 欧美一卡2卡3卡4卡| 日本一区二区综合亚洲| 亚洲高清免费观看高清完整版在线观看| 日韩精品视频网| 9i在线看片成人免费| 日韩欧美一级二级三级久久久| 国产欧美精品一区二区三区四区| 一区二区在线免费观看| 激情文学综合丁香| 欧美日韩美少妇| 国产精品久久久久久久午夜片 | 7777精品伊人久久久大香线蕉| 欧美精品一区二区三区视频| 亚洲午夜精品久久久久久久久| 国产精品1区2区| 91精品国产乱码久久蜜臀| 日韩一区在线看| 激情国产一区二区| 欧美高清dvd| 亚洲视频狠狠干| 国产福利一区在线观看| 日韩一区二区影院| 亚洲乱码一区二区三区在线观看| 国产精品一区一区| 91麻豆精品国产综合久久久久久 | 91黄色免费观看| 中文字幕不卡三区| 国产一区二区三区精品欧美日韩一区二区三区 | 91亚洲资源网| 国产欧美1区2区3区| 国产在线一区观看| 日韩一本二本av| 日韩高清国产一区在线| 欧美性猛片xxxx免费看久爱| 天堂久久一区二区三区| 成人激情av网| 国产人久久人人人人爽| 久久精品99国产精品日本| 欧美一区二区美女| 天堂成人国产精品一区| 欧美色倩网站大全免费| 亚洲黄色小视频| 日本韩国视频一区二区| 亚洲精品免费在线观看| 在线观看视频一区二区| 亚洲精品第1页| 欧美亚洲高清一区| 亚州成人在线电影| 欧美一三区三区四区免费在线看| 五月天中文字幕一区二区| 91精品国产麻豆国产自产在线|