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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pc.c

?? 在Keil C環(huán)境下運行的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
*********************************************************************************************************
*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av网站免费在线| 欧美videos大乳护士334| 中文字幕人成不卡一区| 粉嫩一区二区三区性色av| 国产日韩欧美a| 国产大陆a不卡| 亚洲女人小视频在线观看| 欧美色图第一页| 日韩激情在线观看| 国产日韩欧美在线一区| 99久久精品国产毛片| 亚洲1区2区3区视频| 日韩写真欧美这视频| 国产老肥熟一区二区三区| 国产精品久久久久四虎| 欧美亚洲国产怡红院影院| 蜜臀91精品一区二区三区| 欧美国产成人在线| 欧美日韩三级视频| 国产福利一区二区三区视频在线| 亚洲色图第一区| 日韩一级完整毛片| 成人高清免费观看| 爽好多水快深点欧美视频| 精品国产乱码久久久久久闺蜜| 成人在线视频一区| 性久久久久久久| 日本一区二区免费在线观看视频| 欧美亚洲国产一区二区三区 | 国产一区免费电影| 一区在线观看视频| 日韩一卡二卡三卡| 色呦呦一区二区三区| 久久精品国产精品亚洲红杏| **网站欧美大片在线观看| 91精品婷婷国产综合久久性色| 成年人国产精品| 狂野欧美性猛交blacked| 自拍av一区二区三区| xnxx国产精品| 欧美日韩在线观看一区二区| 国产麻豆一精品一av一免费 | 亚洲视频一二三区| 欧美成人综合网站| 欧美人妖巨大在线| 99这里都是精品| 韩国女主播一区| 日日夜夜精品免费视频| 亚洲视频综合在线| 国产色91在线| 欧美videos中文字幕| 欧美日韩国产另类一区| 91免费版在线| 粉嫩绯色av一区二区在线观看| 热久久国产精品| 香蕉乱码成人久久天堂爱免费| 国产精品福利一区二区三区| xnxx国产精品| 精品国产免费一区二区三区四区| 欧美日韩一区二区在线视频| 一本色道久久综合亚洲91| 国产成人av福利| 精品一区二区三区日韩| 美腿丝袜亚洲三区| 蜜臀国产一区二区三区在线播放 | 91国偷自产一区二区开放时间| 国产成人av在线影院| 国产精品白丝jk黑袜喷水| 国内精品在线播放| 国内欧美视频一区二区| 久久99久久精品欧美| 免费精品99久久国产综合精品| 亚洲不卡在线观看| 婷婷综合久久一区二区三区| 亚洲午夜久久久| 婷婷中文字幕综合| 天堂av在线一区| 日韩 欧美一区二区三区| 日韩成人伦理电影在线观看| 日本免费新一区视频| 奇米色一区二区三区四区| 美女免费视频一区二区| 久久国产乱子精品免费女| 国产一区二区导航在线播放| 国产精品99久| 高清视频一区二区| 成人三级伦理片| 91麻豆swag| 56国语精品自产拍在线观看| 日韩午夜av一区| 精品成人一区二区| 日本一区二区三级电影在线观看 | 成人精品一区二区三区四区| 国产xxx精品视频大全| 91原创在线视频| 欧美天天综合网| 欧美mv和日韩mv国产网站| 国产色产综合产在线视频| 亚洲免费观看高清| 亚洲成人精品在线观看| 精品一区二区三区在线视频| 成人黄色电影在线| 在线免费观看日本欧美| 91麻豆精品91久久久久同性| 国产午夜亚洲精品羞羞网站| 一区二区三区久久久| 久久精品国产77777蜜臀| 成人动漫av在线| 欧美日韩国产精品自在自线| 久久久久国产成人精品亚洲午夜| 亚洲人成在线播放网站岛国| 日本美女一区二区| 99麻豆久久久国产精品免费| 欧美日韩一区二区三区视频| 精品捆绑美女sm三区| 亚洲柠檬福利资源导航| 美女脱光内衣内裤视频久久网站| 国产成人免费视频| 欧美视频日韩视频| 久久免费偷拍视频| 亚洲午夜一区二区| 懂色av一区二区在线播放| 欧美日韩另类国产亚洲欧美一级| 久久日韩精品一区二区五区| 亚洲一区二区免费视频| 国产一区二区伦理| 欧美精品1区2区3区| 国产精品水嫩水嫩| 精品一区二区三区免费视频| 91成人免费在线| 国产精品免费久久| 九一久久久久久| 欧美无砖砖区免费| 中文字幕日本不卡| 国产精品88av| 欧美mv日韩mv亚洲| 日日夜夜精品免费视频| 91美女蜜桃在线| 国产欧美日韩另类一区| 秋霞av亚洲一区二区三| 色www精品视频在线观看| 国产精品久久毛片av大全日韩| 免费xxxx性欧美18vr| 欧美性xxxxx极品少妇| 最新欧美精品一区二区三区| 国产成人在线视频免费播放| 欧美一卡在线观看| 亚洲午夜私人影院| 日本高清无吗v一区| 亚洲天堂成人网| 成人免费看黄yyy456| 国产丝袜美腿一区二区三区| 日韩成人精品在线观看| 欧美日韩高清一区二区三区| 亚洲一区二区影院| 99精品国产99久久久久久白柏| 国产亚洲人成网站| 国产一区在线精品| 精品久久人人做人人爰| 婷婷开心激情综合| 777xxx欧美| 福利91精品一区二区三区| 亚洲精品在线三区| 激情亚洲综合在线| 欧美日韩视频第一区| 亚洲猫色日本管| 日本丶国产丶欧美色综合| 一区二区三区在线视频观看| 91国偷自产一区二区三区成为亚洲经典 | 成人蜜臀av电影| 国产精品理伦片| 97久久精品人人做人人爽50路| 国产精品美女久久久久高潮| 成人av网站免费| 亚洲久草在线视频| 欧美色成人综合| 美女高潮久久久| 欧美国产欧美综合| 经典一区二区三区| 成人精品免费网站| 最新国产成人在线观看| 在线观看日韩高清av| 亚洲最新在线观看| 蜜桃视频一区二区三区在线观看| 日本不卡中文字幕| 国产精品素人一区二区| 波多野结衣一区二区三区| 免费欧美在线视频| 日韩欧美国产综合一区| 国产精品456| 午夜欧美2019年伦理| 美女在线视频一区| 欧美精品在欧美一区二区少妇| 婷婷成人综合网| 欧美激情一区不卡| 欧美一区二区三区系列电影| 国产成人精品网址| 97se亚洲国产综合自在线观| 欧美tickling网站挠脚心| 激情小说亚洲一区|