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

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

?? datapage.c

?? MC9s12d系列單片機中斷程序實例
?? C
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************
  FILE        : datapage.c
  PURPOSE     : paged data access runtime routines
  MACHINE     : Freescale 68HC12 (Target)
  LANGUAGE    : ANSI-C
  HISTORY     : 21.7.96 first version created
******************************************************************************/

#include "hidef.h"

#include "non_bank.sgm"
#include "runtime.sgm"



#ifndef __HCS12X__ /* it's different for the HCS12X. See the text below at the #else // __HCS12X__ */

/*
   According to the -Cp option of the compiler the
   __DPAGE__, __PPAGE__ and __EPAGE__ macros are defined.
   If none of them is given as argument, then no page accesses should occur and
   this runtime routine should not be used !
   To be on the save side, the runtime routines are created anyway.
   If some of the -Cp options are given an adapted versions which only covers the
   needed cases is produced.
*/

/* if no compiler option -Cp is given, it is assumed that all possible are given : */

/* Compile with option -DHCS12 to activate this code */
#if defined(HCS12) || defined(_HCS12) || defined(__HCS12__) /* HCS12 family has PPAGE register only at 0x30 */
#define PPAGE_ADDR (0x30+REGISTER_BASE)
#ifndef __PPAGE__ /* may be set already by option -CPPPAGE */
#define __PPAGE__
#endif
/* Compile with option -DDG128 to activate this code */
#elif defined DG128 /* HC912DG128 derivative has PPAGE register only at 0xFF */
#define PPAGE_ADDR (0xFF+REGISTER_BASE)
#ifndef __PPAGE__ /* may be set already by option -CPPPAGE */
#define __PPAGE__
#endif
#elif defined(HC812A4)
/* all setting default to A4 already */
#endif


#if !defined(__EPAGE__) && !defined(__PPAGE__) && !defined(__DPAGE__)
/* as default use all page registers */
#define __DPAGE__
#define __EPAGE__
#define __PPAGE__
#endif

/* modify the following defines to your memory configuration */

#define EPAGE_LOW_BOUND   0x400u
#define EPAGE_HIGH_BOUND  0x7ffu

#define DPAGE_LOW_BOUND   0x7000u
#define DPAGE_HIGH_BOUND  0x7fffu

#define PPAGE_LOW_BOUND   (DPAGE_HIGH_BOUND+1)
#define PPAGE_HIGH_BOUND  0xBFFFu

#define REGISTER_BASE      0x0u
#ifndef DPAGE_ADDR
#define DPAGE_ADDR        (0x34u+REGISTER_BASE)
#endif
#ifndef EPAGE_ADDR
#define EPAGE_ADDR        (0x36u+REGISTER_BASE)
#endif
#ifndef PPAGE_ADDR
#define PPAGE_ADDR        (0x35u+REGISTER_BASE)
#endif

/*
  The following parts about the defines are assumed in the code of _GET_PAGE_REG :
  - the memory region controlled by DPAGE is above the area controlled by the EPAGE and
    below the area controlled by the PPAGE.
  - the lower bound of the PPAGE area is equal to be the higher bound of the DPAGE area + 1
*/
#if EPAGE_LOW_BOUND >= EPAGE_HIGH_BOUND || EPAGE_HIGH_BOUND >= DPAGE_LOW_BOUND || DPAGE_LOW_BOUND >= DPAGE_HIGH_BOUND || DPAGE_HIGH_BOUND >= PPAGE_LOW_BOUND || PPAGE_LOW_BOUND >= PPAGE_HIGH_BOUND
#error /* please adapt _GET_PAGE_REG for this non default page configuration */
#endif

#if DPAGE_HIGH_BOUND+1 != PPAGE_LOW_BOUND
#error /* please adapt _GET_PAGE_REG for this non default page configuration */
#endif


/* this module does either control if any access is in the bounds of the specified page or */
/* ,if only one page is specified, just use this page. */
/* This behavior is controlled by the define USE_SEVERAL_PAGES. */
/* If !USE_SEVERAL_PAGES does increase the performance significantly */
/* NOTE : When !USE_SEVERAL_PAGES, the page is also set for accesses outside of the area controlled */
/*        by this single page. But this is should not cause problems because the page is restored to the old value before any other access could occur */

#if !defined(__DPAGE__) && !defined(__EPAGE__) && !defined(__PPAGE__)
/* no page at all is specified */
/* only specifying the right pages will speed up these functions a lot */
#define USE_SEVERAL_PAGES 1
#elif defined(__DPAGE__) && defined(__EPAGE__) || defined(__DPAGE__) && defined(__PPAGE__) || defined(__EPAGE__) && defined(__PPAGE__)
/* more than one page register is used */
#define USE_SEVERAL_PAGES 1
#else

#define USE_SEVERAL_PAGES 0

#if defined(__DPAGE__) /* check which pages are used  */
#define PAGE_ADDR PPAGE_ADDR
#elif defined(__EPAGE__)
#define PAGE_ADDR EPAGE_ADDR
#elif defined(__PPAGE__)
#define PAGE_ADDR PPAGE_ADDR
#else /* we do not know which page, decide it at runtime */
#error /* must not happen */
#endif

#endif


#if USE_SEVERAL_PAGES /* only needed for several pages support */
/*--------------------------- _GET_PAGE_REG --------------------------------
  Runtime routine to detect the right register depending on the 16 bit offset part
  of an address.
  This function is only used by the functions below.

  Depending on the compiler options -Cp different versions of _GET_PAGE_REG are produced.

  Arguments :
  - Y : offset part of an address

  Result :
  if address Y is controlled by a page register :
  - X : address of page register if Y is controlled by an page register
  - Zero flag cleared
  - all other registers remain unchanged

  if address Y is not controlled by a page register :
  - Zero flag is set
  - all registers remain unchanged

  --------------------------- _GET_PAGE_REG ----------------------------------*/

#if defined(__DPAGE__)

#ifdef __cplusplus
extern "C"
#endif
#pragma NO_ENTRY
#pragma NO_EXIT
#pragma NO_FRAME

static void NEAR _GET_PAGE_REG(void) { /*lint -esym(528, _GET_PAGE_REG) used in asm code */
  __asm {
L_DPAGE:
        CPY     #DPAGE_LOW_BOUND  ;// test of lower bound of DPAGE
#if defined(__EPAGE__)
        BLO     L_EPAGE           ;// EPAGE accesses are possible
#else
        BLO     L_NOPAGE          ;// no paged memory below accesses
#endif
        CPY     #DPAGE_HIGH_BOUND ;// test of higher bound DPAGE/lower bound PPAGE
#if defined(__PPAGE__)
        BHI     L_PPAGE           ;// EPAGE accesses are possible
#else
        BHI     L_NOPAGE          ;// no paged memory above accesses
#endif
FOUND_DPAGE:
        LDX     #DPAGE_ADDR       ;// load page register address and clear zero flag
        RTS

#if defined(__PPAGE__)
L_PPAGE:
        CPY     #PPAGE_HIGH_BOUND ;// test of higher bound of PPAGE
        BHI     L_NOPAGE
FOUND_PPAGE:
        LDX     #PPAGE_ADDR       ;// load page register address and clear zero flag
        RTS
#endif

#if defined(__EPAGE__)
L_EPAGE:
        CPY     #EPAGE_LOW_BOUND  ;// test of lower bound of EPAGE
        BLO     L_NOPAGE
        CPY     #EPAGE_HIGH_BOUND ;// test of higher bound of EPAGE
        BHI     L_NOPAGE

FOUND_EPAGE:
        LDX     #EPAGE_ADDR       ;// load page register address and clear zero flag
        RTS
#endif

L_NOPAGE:
        ORCC    #0x04             ;// sets zero flag
        RTS
  }
}

#else /* !defined(__DPAGE__) */

#if defined( __PPAGE__ )

#ifdef __cplusplus
extern "C"
#endif
#pragma NO_ENTRY
#pragma NO_EXIT
#pragma NO_FRAME

static void NEAR _GET_PAGE_REG(void) {	/*lint -esym(528, _GET_PAGE_REG) used in asm code */
  __asm {
L_PPAGE:
        CPY     #PPAGE_LOW_BOUND  ;// test of lower bound of PPAGE
#if defined( __EPAGE__ )
        BLO     L_EPAGE
#else
        BLO     L_NOPAGE          ;// no paged memory below
#endif
        CPY     #PPAGE_HIGH_BOUND ;// test of higher bound PPAGE
        BHI     L_NOPAGE
FOUND_PPAGE:
        LDX     #PPAGE_ADDR       ;// load page register address and clear zero flag
        RTS
#if defined( __EPAGE__ )
L_EPAGE:
        CPY     #EPAGE_LOW_BOUND  ;// test of lower bound of EPAGE
        BLO     L_NOPAGE
        CPY     #EPAGE_HIGH_BOUND ;// test of higher bound of EPAGE
        BHI     L_NOPAGE
FOUND_EPAGE:
        LDX     #EPAGE_ADDR       ;// load page register address and clear zero flag
        RTS
#endif

L_NOPAGE:                         ;// not in any allowed page area
                                  ;// its a far access to a non paged variable
        ORCC #0x04                ;// sets zero flag
        RTS
  }
}

#else /* !defined(__DPAGE__ ) && !defined( __PPAGE__) */
#if defined(__EPAGE__)

#ifdef __cplusplus
extern "C"
#endif
#pragma NO_ENTRY
#pragma NO_EXIT
#pragma NO_FRAME

static void NEAR _GET_PAGE_REG(void) { /*lint -esym(528, _GET_PAGE_REG) used in asm code */
  __asm {
L_EPAGE:
        CPY     #EPAGE_LOW_BOUND  ;// test of lower bound of EPAGE
        BLO     L_NOPAGE
        CPY     #EPAGE_HIGH_BOUND ;// test of higher bound of EPAGE
        BHI     L_NOPAGE
FOUND_EPAGE:
        LDX     #EPAGE_ADDR       ;// load page register address and clear zero flag
        RTS

L_NOPAGE:                         ;// not in any allowed page area
                                  ;// its a far access to a non paged variable
        ORCC    #0x04             ;// sets zero flag
        RTS
  }
}

#endif /*  defined(__EPAGE__) */
#endif /*  defined(__PPAGE__) */
#endif /*  defined(__DPAGE__) */

#endif /* USE_SEVERAL_PAGES */

/*--------------------------- _SET_PAGE --------------------------------
  Runtime routine to set the right page register. This routine is used if the compiler
  does not know the right page register, i.e. if the option -Cp is used for more than
  one page register or if the runtime option is used for one of the -Cp options.

  Arguments :
  - offset part of an address in the Y register
  - page part of an address in the B register

  Result :
  - page part written into the correct page register.
  - the old page register content is destroyed
  - all processor registers remains unchanged
  --------------------------- _SET_PAGE ----------------------------------*/

#ifdef __cplusplus
extern "C"
#endif
#pragma NO_ENTRY
#pragma NO_EXIT
#pragma NO_FRAME

void NEAR _SET_PAGE(void) {
#if USE_SEVERAL_PAGES
  __asm {
        PSHX                      ;// save X register
        __PIC_JSR(_GET_PAGE_REG)
        BEQ     L_NOPAGE
        STAB    0,X               ;// set page register
L_NOPAGE:
        PULX                      ;// restore X register
        RTS
  }
#else /* USE_SEVERAL_PAGES */
  __asm {
        STAB    PAGE_ADDR         ;// set page register
        RTS
  }
#endif /* USE_SEVERAL_PAGES */
}

/*--------------------------- _LOAD_FAR_8 --------------------------------
  This runtime routine is used to access paged memory via a runtime function.
  It may also be used if the compiler option -Cp is not used with the runtime argument.

  Arguments :
  - offset part of an address in the Y register
  - page part of an address in the B register

  Result :
  - value to be read in the B register
  - all other registers remains unchanged
  - all page register still contain the same value
  --------------------------- _LOAD_FAR_8 ----------------------------------*/

#ifdef __cplusplus
extern "C"
#endif
#pragma NO_ENTRY
#pragma NO_EXIT
#pragma NO_FRAME

void NEAR _LOAD_FAR_8(void) {
#if USE_SEVERAL_PAGES
  __asm {
        PSHX                      ;// save X register
        __PIC_JSR(_GET_PAGE_REG)
        BEQ     L_NOPAGE
        PSHA                      ;// save A register
        LDAA    0,X               ;// save page register
        STAB    0,X               ;// set page register
        LDAB    0,Y               ;// actual load, overwrites page
        STAA    0,X               ;// restore page register
        PULA                      ;// restore A register
        PULX                      ;// restore X register
        RTS
L_NOPAGE:
        LDAB    0,Y               ;// actual load, overwrites page
        PULX                      ;// restore X register
        RTS
  }
#else /* USE_SEVERAL_PAGES */
  __asm {
        PSHA                      ;// save A register
        LDAA    PAGE_ADDR         ;// save page register
        STAB    PAGE_ADDR         ;// set page register
        LDAB    0,Y               ;// actual load, overwrites page
        STAA    PAGE_ADDR         ;// restore page register
        PULA                      ;// restore A register
        RTS
  }
#endif /* USE_SEVERAL_PAGES */
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
福利91精品一区二区三区| 日韩欧美国产一区在线观看| 日韩一级大片在线| 中文字幕一区二区不卡| 久久电影国产免费久久电影| 欧美伊人精品成人久久综合97| 久久九九影视网| 奇米影视在线99精品| 日本韩国精品一区二区在线观看| 国产亚洲精品中文字幕| 日韩国产欧美三级| 欧美在线一区二区| 中文字幕亚洲一区二区va在线| 国产中文字幕精品| 欧美一区二区三区系列电影| 亚洲一区二区三区美女| 在线区一区二视频| 亚洲美女视频一区| 91亚洲精华国产精华精华液| 欧美韩国日本不卡| 国产aⅴ精品一区二区三区色成熟| 日韩免费观看2025年上映的电影 | 欧美三区在线观看| 综合电影一区二区三区| a美女胸又www黄视频久久| 欧美高清在线精品一区| 国产精一品亚洲二区在线视频| 日韩视频123| 免费成人美女在线观看.| 69av一区二区三区| 蜜臀国产一区二区三区在线播放| 欧美一级一区二区| 精品一区二区三区久久| 亚洲精品一线二线三线无人区| 韩国v欧美v亚洲v日本v| 久久久91精品国产一区二区精品| 国产一区二区三区在线观看免费| 久久尤物电影视频在线观看| 国产高清不卡二三区| 国产精品免费视频网站| 99精品桃花视频在线观看| 中文字幕一区二区视频| 在线中文字幕不卡| 日本最新不卡在线| 久久尤物电影视频在线观看| 国产不卡在线视频| 尤物视频一区二区| 91精品国产综合久久久久| 极品少妇一区二区| 国产精品高清亚洲| 欧美日韩久久一区| 韩国精品一区二区| 亚洲免费资源在线播放| 欧美精品国产精品| 豆国产96在线|亚洲| 亚洲一区二区五区| 久久综合九色综合97婷婷女人| 成人激情免费视频| 视频一区欧美精品| 亚洲国产精品精华液ab| 欧美三级电影一区| 国产成人亚洲综合a∨猫咪| 一区二区三区在线观看视频 | 久久亚洲欧美国产精品乐播| 国产a久久麻豆| 五月天视频一区| 中文字幕不卡一区| 9191国产精品| 色综合咪咪久久| 麻豆视频一区二区| 一区二区在线免费| 26uuu精品一区二区三区四区在线| caoporen国产精品视频| 麻豆精品蜜桃视频网站| 亚洲女子a中天字幕| 精品日韩一区二区| 91麻豆精东视频| 老司机免费视频一区二区| 亚洲色图色小说| 国产色爱av资源综合区| 91精品国产手机| 在线一区二区视频| 国产91精品久久久久久久网曝门| 日本在线观看不卡视频| 亚洲人精品午夜| 欧美国产一区在线| 精品福利一区二区三区| 欧美理论电影在线| 成人动漫视频在线| 国产精品1区2区| 黑人精品欧美一区二区蜜桃 | 日韩一区二区在线看| 色丁香久综合在线久综合在线观看| 黄页网站大全一区二区| 蜜桃在线一区二区三区| 亚洲午夜激情网页| 怡红院av一区二区三区| 中文字幕不卡在线观看| 久久精品视频在线免费观看| 日韩亚洲欧美一区| 9191成人精品久久| 4438成人网| 欧美精品三级在线观看| 欧美久久久一区| 欧美日韩精品一区二区在线播放| 91成人国产精品| 欧美图区在线视频| 欧美精品欧美精品系列| 欧美日韩一区二区三区在线看 | 一区二区三区中文字幕精品精品| 国产精品久久久久四虎| 国产精品久久久久一区| 成人免费一区二区三区视频| 亚洲视频图片小说| 中文字幕一区二区三区在线播放| 国产精品萝li| 亚洲欧美日韩小说| 亚洲图片欧美视频| 日韩vs国产vs欧美| 狠狠色丁香九九婷婷综合五月| 精品一区二区三区欧美| 国产成人久久精品77777最新版本| 高清视频一区二区| 色综合天天综合网国产成人综合天| 97se亚洲国产综合自在线不卡| 一本一道久久a久久精品 | 成人app软件下载大全免费| 成人av电影在线| 色综合网色综合| 欧美人与z0zoxxxx视频| 精品日韩一区二区三区免费视频| 久久麻豆一区二区| 亚洲卡通欧美制服中文| 亚洲成人动漫在线免费观看| 久久99精品国产麻豆婷婷| 国产91在线看| 91福利精品视频| 精品成人免费观看| 亚洲人成亚洲人成在线观看图片 | 亚洲自拍偷拍九九九| 日本在线不卡一区| 成人av资源下载| 欧美精品久久天天躁| 国产亚洲精品免费| 亚洲午夜久久久久中文字幕久| 久久超级碰视频| 95精品视频在线| 欧美成人综合网站| 亚洲九九爱视频| 国产一区中文字幕| 欧美日韩视频在线第一区| 久久综合久久综合久久| 亚洲在线观看免费| 国产河南妇女毛片精品久久久| 一本久久精品一区二区| 欧美mv日韩mv亚洲| 一区二区欧美精品| 国产一区二区不卡老阿姨| 欧美午夜在线一二页| 国产片一区二区| 免费不卡在线观看| 欧美伊人久久久久久久久影院 | av一区二区久久| 日韩欧美国产成人一区二区| 亚洲欧美区自拍先锋| 国内精品写真在线观看| 欧美性大战xxxxx久久久| 国产精品免费视频一区| 精品伊人久久久久7777人| 欧美丝袜丝交足nylons| 中文字幕一区免费在线观看| 国产精品伊人色| 精品精品欲导航| 日韩综合小视频| 欧美无砖砖区免费| 亚洲手机成人高清视频| 国产成a人亚洲精| 国产亚洲婷婷免费| 精品一区二区三区免费毛片爱| 欧美日韩你懂得| 亚洲一区二区3| 在线欧美日韩精品| 亚洲美女在线国产| 在线中文字幕一区| 樱花影视一区二区| 色综合色综合色综合| 亚洲视频一区二区在线观看| 粉嫩在线一区二区三区视频| 久久久精品tv| 国产成人在线观看免费网站| 精品福利一二区| 国产综合久久久久影院| 日韩精品一区二区三区swag| 男人的天堂久久精品| 日韩亚洲欧美综合| 麻豆精品精品国产自在97香蕉| 666欧美在线视频| 日韩国产精品大片| 欧美一个色资源| 另类人妖一区二区av|