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

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

?? pc.c

?? 這是利用RTOS去實現機械系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
*********************************************************************************************************
*                                          PC SUPPORT FUNCTIONS
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : PC.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#include "includes.h"

/*
*********************************************************************************************************
*                                               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*/
/*
*********************************************************************************************************
*                           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)
{
    INT8U  far *pscr;
    INT16U      offset;


    offset  = (INT16U)y * DISP_MAX_X * 2 + (INT16U)x * 2;  /* Calculate position on the screen         */
    pscr    = (INT8U far *)MK_FP(DISP_BASE, offset);
    *pscr++ = c;                                           /* Put character in video RAM               */
    *pscr   = color;                                       /* Put video attribute in video RAM         */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                            CLEAR A COLUMN
*
* Description : This function clears one of the 80 columns 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   : x            corresponds to the desired column to clear.  Valid column numbers are from 
*                            0 to 79.  Column 0 corresponds to the leftmost column.
*
*               color        specifies the foreground/background color combination to use 
*                            (see PC.H for available choices)
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispClrCol (INT8U x, INT8U color)
{
    INT8U far *pscr;
    INT8U      i;


    pscr = (INT8U far *)MK_FP(DISP_BASE, (INT16U)x * 2);
    for (i = 0; i < DISP_MAX_Y; i++) {
        *pscr++ = ' ';                           /* Put ' ' character in video RAM                     */
        *pscr-- = color;                         /* Put video attribute in video RAM                   */
        pscr    = pscr + DISP_MAX_X * 2;         /* Position on next row                               */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             CLEAR A ROW
*
* 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 row to clear.  Valid row numbers are from 
*                            0 to 24.  Row 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_DispClrRow (INT8U y, INT8U color)
{
    INT8U far *pscr;
    INT8U      i;


    pscr = (INT8U far *)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*/
/*
*********************************************************************************************************
*                                              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)
{
    INT8U  far *pscr;
    INT16U      i;


    pscr = (INT8U far *)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*/
/*
*********************************************************************************************************
*                                 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)
{
    INT8U  far *pscr;
    INT16U      offset;


    offset  = (INT16U)y * DISP_MAX_X * 2 + (INT16U)x * 2;   /* Calculate position of 1st character     */
    pscr    = (INT8U far *)MK_FP(DISP_BASE, offset);
    while (*s) {
        *pscr++ = *s++;                                     /* Put character in video RAM              */
        *pscr++ = color;                                    /* Put video attribute in video RAM        */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             RETURN TO DOS
*
* Description : This functions returns control back to DOS by doing a 'long jump' back to the saved
*               location stored in 'PC_JumpBuf'.  The saved location was established by the function
*               'PC_DOSSaveReturn()'.  After execution of the long jump, execution will resume at the 
*               line following the 'set jump' back in 'PC_DOSSaveReturn()'.  Setting the flag 
*               'PC_ExitFlag' to TRUE ensures that the 'if' statement in 'PC_DOSSaveReturn()' executes.
*
* Arguments   : None
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DOSReturn (void)
{
    PC_ExitFlag = TRUE;                                    /* Indicate we are returning to DOS         */
    longjmp(PC_JumpBuf, 1);                                /* Jump back to saved environment           */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        SAVE DOS RETURN LOCATION
*
* Description : This function saves the location of where we are in DOS so that it can be recovered.
*               This allows us to abort multitasking under uC/OS-II and return back to DOS as if we had
*               never left.  When this function is called by 'main()', it sets 'PC_ExitFlag' to FALSE
*               so that we don't take the 'if' branch.  Instead, the CPU registers are saved in the
*               long jump buffer 'PC_JumpBuf' and we simply return to the caller.  If a 'long jump' is
*               performed using the jump buffer then, execution would resume at the 'if' statement and
*               this time, if 'PC_ExitFlag' is set to TRUE then we would execute the 'if' statements and
*               restore the DOS environment.
*
* Arguments   : None
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DOSSaveReturn (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


    PC_ExitFlag  = FALSE;                                  /* Indicate that we are not exiting yet!    */
    OSTickDOSCtr =     1;                                  /* Initialize the DOS tick counter          */
    PC_TickISR   = PC_VectGet(VECT_TICK);                  /* Get MS-DOS's tick vector                 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆视频一区二区| 国产精品乱码人人做人人爱| 94色蜜桃网一区二区三区| 久久aⅴ国产欧美74aaa| 日产国产欧美视频一区精品| 婷婷综合另类小说色区| 亚洲国产成人av网| 三级久久三级久久久| 三级在线观看一区二区| 欧美a一区二区| 激情文学综合插| 国产成人精品www牛牛影视| 国内精品不卡在线| 粉嫩av一区二区三区在线播放| 国产一区二区三区在线观看免费| 国产精品69毛片高清亚洲| 国产一区视频网站| av电影天堂一区二区在线观看| 99久久er热在这里只有精品15| 91亚洲国产成人精品一区二三 | 夜夜嗨av一区二区三区网页| 一区二区在线观看视频| 亚洲国产成人高清精品| 麻豆精品一区二区三区| 国产成人免费高清| 色妞www精品视频| 欧美人妖巨大在线| 精品国产免费视频| 综合久久久久久| 偷拍与自拍一区| 国产成都精品91一区二区三| 91丝袜呻吟高潮美腿白嫩在线观看| 在线观看一区二区视频| 91精品国产色综合久久久蜜香臀| 欧美精品一区二区三区久久久| 国产精品热久久久久夜色精品三区| 亚洲黄色在线视频| 日韩成人一区二区三区在线观看| 国产乱码精品一区二区三区av| 91亚洲国产成人精品一区二三 | 久久综合五月天婷婷伊人| 中文字幕中文字幕一区二区| 亚洲福利一二三区| 国产福利视频一区二区三区| 欧美一二三区在线观看| 国产嫩草影院久久久久| 午夜私人影院久久久久| 成人精品电影在线观看| 欧美一区二区三区系列电影| 国产精品久久久久国产精品日日| 蜜桃一区二区三区在线观看| 99国产精品国产精品久久| 精品三级在线看| 亚洲va欧美va国产va天堂影院| 成人av综合一区| 久久久久久久久伊人| 日韩av在线播放中文字幕| 91女神在线视频| 欧美激情艳妇裸体舞| 美女网站在线免费欧美精品| 欧美日韩一区三区| 亚洲激情五月婷婷| 成人av午夜电影| 国产欧美精品在线观看| 久久99国产精品麻豆| 欧美日韩高清不卡| 亚洲午夜久久久久久久久电影网| 波多野结衣中文字幕一区二区三区| 精品国产百合女同互慰| 毛片av中文字幕一区二区| 欧美日韩黄视频| 亚洲一卡二卡三卡四卡无卡久久| www.亚洲国产| 中文字幕av一区二区三区免费看| 激情亚洲综合在线| 精品国产不卡一区二区三区| 麻豆精品视频在线观看| 日韩一区二区免费高清| 午夜精品久久久久久久 | 51精品秘密在线观看| 亚洲在线视频网站| 日本韩国欧美国产| 一区二区成人在线视频 | 美女国产一区二区三区| 3atv一区二区三区| 日本欧美久久久久免费播放网| 欧美久久久久中文字幕| 日韩高清不卡一区二区| 日韩欧美一区二区视频| 极品美女销魂一区二区三区| 欧美精品一区二区蜜臀亚洲| 国产98色在线|日韩| 国产精品国产三级国产| 在线免费观看日本一区| 亚洲成人7777| 精品处破学生在线二十三| 国产成人免费视| 一区二区三区不卡在线观看| 欧美乱熟臀69xxxxxx| 久久99国产精品免费网站| 欧美激情一区二区| 欧美亚洲国产怡红院影院| 蜜臀久久99精品久久久久宅男| 精品美女被调教视频大全网站| 懂色一区二区三区免费观看| 亚洲日穴在线视频| 欧美一级片在线| 成人小视频免费在线观看| 亚洲综合免费观看高清完整版在线 | 美国十次综合导航| 久久久www成人免费无遮挡大片| av亚洲精华国产精华精| 午夜av电影一区| 欧美国产欧美亚州国产日韩mv天天看完整| 色噜噜狠狠一区二区三区果冻| 秋霞电影一区二区| 亚洲私人黄色宅男| 欧美成人a视频| 欧美色网站导航| 成人激情视频网站| 久久99久久精品欧美| 亚洲精品成人精品456| 精品免费日韩av| 欧美群妇大交群中文字幕| 成人午夜视频免费看| 蜜臀av一区二区三区| 亚洲制服丝袜av| 国产精品第13页| 国产调教视频一区| 91精品国产入口| 在线看不卡av| 成人av综合在线| 国产成人在线视频播放| 免费观看在线色综合| 亚洲狠狠爱一区二区三区| 国产精品久久久久三级| 久久久久久久一区| 精品国内片67194| 日韩欧美国产一区二区在线播放| 在线视频一区二区三| 99re这里只有精品6| 国产98色在线|日韩| 国产一区欧美一区| 久久99久国产精品黄毛片色诱| 偷偷要91色婷婷| 亚洲高清三级视频| 亚洲一区二区三区四区的| 亚洲欧洲日韩在线| 国产精品久久久久久久浪潮网站| 欧美精品一区二区三区蜜桃| 日韩欧美久久久| 精品国精品自拍自在线| 日韩亚洲欧美在线| 91精品国产品国语在线不卡| 制服丝袜亚洲网站| 欧美一区二区三区免费在线看| 欧美电影一区二区| 91精品国产欧美一区二区| 91精品国产综合久久久久久久 | 日韩一区二区三区在线视频| 制服丝袜在线91| 精品日韩99亚洲| 久久综合成人精品亚洲另类欧美| 久久伊99综合婷婷久久伊| 久久综合久久鬼色中文字| 日本一区二区免费在线观看视频| 国产亚洲欧美在线| 中文字幕欧美一| 亚洲成人午夜影院| 免费成人深夜小野草| 国产精品综合久久| 99精品国产热久久91蜜凸| 欧美午夜一区二区三区免费大片| 欧美日韩视频在线一区二区| 7777女厕盗摄久久久| 26uuu亚洲综合色欧美 | 舔着乳尖日韩一区| 国产在线麻豆精品观看| 成人做爰69片免费看网站| 在线免费观看日本一区| 日韩欧美二区三区| 欧美国产国产综合| 午夜精品一区二区三区免费视频| 久久精品99久久久| 成人激情综合网站| 欧美日韩三级视频| 国产欧美视频一区二区| 亚洲美腿欧美偷拍| 久久er99热精品一区二区| 99精品在线免费| 日韩免费高清电影| 亚洲另类春色校园小说| 蜜桃久久av一区| 色偷偷久久人人79超碰人人澡 | 国产成人精品影院| 在线观看日韩高清av| 精品国产凹凸成av人网站| 亚洲一区免费在线观看| 国产精品18久久久| 777a∨成人精品桃花网|