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

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

?? datapage.c

?? CAN Example(MC9S12XDP512)
?? C
?? 第 1 頁 / 共 5 頁
字號:
        MOVW    0,SP, 1,+SP       ;// move return address
        RTS
  }
#endif /* USE_SEVERAL_PAGES */
}

/*--------------------------- _FAR_COPY_RC --------------------------------
  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 the source int the X register
  - page part of the source in the A register
  - offset part of the dest int the Y register
  - page part of the dest in the B register
  - number of bytes to be copied at 2,SP. The number of bytes is always > 0

  Result :
  - memory area copied
  - no registers are saved, i.e. all registers may be destroyed
  - all page register still contain the same value
  - number of bytes is released from the stack


  stack-structure at the loop-label:
     0,SP : destination offset
     2,SP : source page
     3,SP : destination page
     4,SP : source offset
     6,SP : points to length to be copied. This function returns after the size

  A usual call to this function looks like:

  struct Huge src, dest;
    ; ...
    LDX  #src
    LDAA #PAGE(src)
    LDY  #dest
    LDAB #PAGE(dest)
    JSR  _FAR_COPY_RC
    DC.W sizeof(struct Huge)
    ; ...

  --------------------------- _FAR_COPY_RC ----------------------------------*/

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

void NEAR _FAR_COPY_RC(void) {
#if USE_SEVERAL_PAGES
  __asm {
        DEX                       ;// source addr-=1, because loop counter ends at 1
        PSHX                      ;// save source offset
        PSHD                      ;// save both pages
        DEY                       ;// destination addr-=1, because loop counter ends at 1
        PSHY                      ;// save destination offset
        LDY     6,SP              ;// Load Return address
        LDX     2,Y+              ;// Load Size to copy
        STY     6,SP              ;// Store adjusted return address
loop:
        LDD     4,SP              ;// load source offset
        LEAY    D,X               ;// calculate actual source address
        LDAB    2,SP              ;// load source page
        __PIC_JSR(_LOAD_FAR_8)    ;// load 1 source byte
        PSHB                      ;// save value
        LDD     0+1,SP            ;// load destination offset
        LEAY    D,X               ;// calculate actual destination address
        PULA                      ;// restore value
        LDAB    3,SP              ;// load destination page
        __PIC_JSR(_STORE_FAR_8)   ;// store one byte
        DEX
        BNE     loop
        LEAS    6,SP              ;// release stack
        _SRET                     ;// debug info only: This is the last instr of a function with a special return
        RTS                       ;// return
  }
#else
  __asm {
        PSHD                      ;// store page registers
        TFR     X,D
        PSHY                      ;// temoporary space
        LDY     4,SP              ;// load return address
        ADDD    2,Y+              ;// calculate source end address. Increment return address
        STY     4,SP
        PULY
        PSHD                      ;// store src end address
        LDAB    2,SP              ;// reload source page
        LDAA    PAGE_ADDR         ;// save page register
        PSHA
loop:
        STAB    PAGE_ADDR         ;// set source page
        LDAA    1,X+              ;// load value
        MOVB    4,SP, PAGE_ADDR   ;// set destination page
        STAA    1,Y+
        CPX     1,SP
        BNE     loop

        LDAA    5,SP+             ;// restore old page value and release stack
        STAA    PAGE_ADDR         ;// store it into page register
        _SRET                     ;// debug info only: This is the last instr of a function with a special return
        RTS
  }
#endif
}

/*--------------------------- _FAR_COPY --------------------------------

  The _FAR_COPY runtime routine was used to copied large memory blocks in previous compiler releases.
  However this relase now does use _FAR_COPY_RC instead. The only difference is how the size of 
  the area to be copied is passed into the function. For _FAR_COPY the size is passed on the stack just
  above the return address. _FAR_COPY_RC does expect the return address just after the JSR _FAR_COPY_RC call
  in the code of the caller. This allows for denser code calling _FAR_COPY_RC but does also need a slightly
  larger runtime routine and it is sligtly slower.
  The _FAR_COPY routine is here now mainly for compatibility with previous releases. 
  The current compiler does not use it. 
  
--------------------------- _FAR_COPY ----------------------------------*/

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

void NEAR _FAR_COPY(void) {
#if USE_SEVERAL_PAGES
  __asm {
        DEX                       ;// source addr-=1, because loop counter ends at 1
        PSHX                      ;// save source offset
        PSHD                      ;// save both pages
        DEY                       ;// destination addr-=1, because loop counter ends at 1
        PSHY                      ;// save destination offset
        LDX     8,SP              ;// load counter, assuming counter > 0

loop:
        LDD     4,SP              ;// load source offset
        LEAY    D,X               ;// calculate actual source address
        LDAB    2,SP              ;// load source page
        __PIC_JSR(_LOAD_FAR_8)    ;// load 1 source byte
        PSHB                      ;// save value
        LDD     0+1,SP            ;// load destination offset
        LEAY    D,X               ;// calculate actual destination address
        PULA                      ;// restore value
        LDAB    3,SP              ;// load destination page
        __PIC_JSR(_STORE_FAR_8)   ;// store one byte
        DEX
        BNE     loop
        LDX     6,SP              ;// load return address
        LEAS    10,SP             ;// release stack
        JMP     0,X               ;// return
  }
#else
  __asm {
        PSHD                      ;// store page registers
        TFR     X,D
        ADDD    4,SP              ;// calculate source end address
        STD     4,SP
        PULB                      ;// reload source page
        LDAA    PAGE_ADDR         ;// save page register
        PSHA
loop:
        STAB    PAGE_ADDR         ;// set source page
        LDAA    1,X+              ;// load value
        MOVB    1,SP, PAGE_ADDR   ;// set destination page
        STAA    1,Y+
        CPX     4,SP
        BNE     loop

        LDAA    2,SP+             ;// restore old page value and release stack
        STAA    PAGE_ADDR         ;// store it into page register
        LDX     4,SP+             ;// release stack and load return address
        JMP     0,X               ;// return
  }
#endif
}

#else  /* __HCS12X__  */

/*
  The HCS12X knows two different kind of addresses:
    - Logical addresses. E.g.
       MOVB #page(var),RPAGE
       INC var

    - Global addresses E.g.
       MOVB #page(var),GPAGE
       GLOAA var
       INCA
       GSTAA var

  Global addresses are used with G-Load's and G-Store's, logical addresses are used for all the other instructions
  and occasions. As HC12's or HCS12's do not have the G-Load and G-Store instructions,
  global addresses are not used with these processor families.
  They are only used with HCS12X chips (and maybe future ones deriving from a HCS12X).

  Logical and Global addresses can point to the same object, however the global and logical address of an object
  are different for most objects (actually for all except the registers from 0 to 0x7FF).
  Therefore the compiler needs to transform in between them.

  HCS12X Pointer types:

    The following are logical addresses:
    - all 16 bit pointers
       - "char* __near": always.
       - "char *" in the small and banked memory model
    - 24 bit dpage, epage, ppage or rpage pointers (*1) (note: the first HCS12X compilers may not support these pointer types)
       - "char *__dpage": Note this type only exists for
                          orthogonality with the HC12 A4 chip which has a DPAGE reg.
                          It does not apply to the HCS12X.
       - "char *__epage": 24 bit pointer using the EPAGE register
       - "char *__ppage": 24 bit pointer using the PPAGE register.
                          As the PPAGE is also used for BANKED code,
                          using this pointer type is only legal from non banked code.
       - "char *__rpage": 24 bit pointer using the RPAGE register


    The following are global addresses:
       "char*": in the large memory model (only HCS12X)
       "char* __far": always for HCS12X.

   (*1): For the HC12 and HCS12 "char* __far" and "char*" in the large memory model are also logical.

   Some notes for the HC12/HCS12 programmers.

   The address of a far object for a HC12 and for a HCS12X is different, even if they are at the same place in the memory mal.
   For the HC12, a far address is using the logical addresses, for the HCS12X however, far addresses are using global addresses.
   This does cause troubles for the unaware!

  HCS12X Logical Memory map

    Logical Addresses           Used for                shadowed at           page register     Global Address

    0x000000 .. 0x0007FF        Peripheral Registers                          Not Paged         0x000000
    0x??0800 .. 0x??0BFF        Paged EEPROM                                  EPAGE (@0x17)     0x100000+EPAGE*0x0400
    0x000C00 .. 0x000FFF        Non Paged EEPROM        0xFF0800..0xFF0FFF    Not Paged         0x13FC00
    0x??1000 .. 0x??1FFF        Paged RAM                                     RPAGE (@0x16)     0x000000+RPAGE*0x1000
    0x002000 .. 0x003FFF        Non Paged RAM           0xFE1000..0xFF1FFF    Not Paged         0x0FE000
    0x004000 .. 0x007FFF        Non Paged FLASH         0xFC8000..0xFCBFFF    Not Paged         0x7F4000
    0x??8000 .. 0x00BFFF        Paged FLASH                                   PPAGE (@0x30)     0x400000+PPAGE*0x4000
    0x00C000 .. 0x00FFFF        Non Paged FLASH         0xFF8000..0xFFBFFF    Not Paged         0x7FC000

    NA: Not Applicable

  HCS12X Global Memory map

    Global Addresses            Used for                Logical mapped at

    0x000000 .. 0x0007FF        Peripheral Registers    0x000000 .. 0x0007FF
    0x000800 .. 0x000FFF        DMA registers           Not mapped
    0x001000 .. 0x0FFFFF        RAM                     0x??1000 .. 0x??1FFF
    0x0FE000 .. 0x0FFFFF        RAM, Log non paged      0x002000 .. 0x003FFF
    0x100000 .. 0x13FFFF        EEPROM                  0x??0800 .. 0x??0BFF
    0x13FC00 .. 0x13FFFF        EEPROM  non paged       0x000C00 .. 0x000FFF
    0x140000 .. 0x3FFFFF        External Space          Not mapped
    0x400000 .. 0x7FFFFF        FLASH                   0x??8000 .. 0x??BFFF
    0x7F4000 .. 0x7F7FFF        FLASH, Log non paged    0x004000 .. 0x007FFF
    0x7FC000 .. 0x7FFFFF        FLASH, Log non paged    0x00C000 .. 0x00FFFF


  How to read this table:
    For logical addresses, the lower 16 bits of the address do determine in which area the address is,
    if this address is paged, then this entry also controls and which of the EPAGE, PPAGE or RPAGE
    page register is controlling the bits 16 to 23 of the address.
    For global addresses, the bits 16 to 23 have to be in the GPAGE register and the lower 16 bits
    have to be used with the special G load or store instructions (e.g. GLDAA).
    As example the logical address 0x123456 is invalid. Because its lower bits 0x3456 are in a
    non paged area, so the page 0x12 does not exist.
    The address 0xFE1020 however does exist. Do access it, the RPAGE has to contain 0xFE and the
    offset 0x1020 has to be used.

      ORG $7000
        MOVB #0xFE, 0x16 ; RPAGE
        LDAA 0x1020      ; reads at the logical address 0xFE1020

    Because the last two RAM pages are also accessible directly from 0x2000 to 0x3FFF, the
    following shorter code does read the same memory location:

      ORG $7000
        LDAA 0x2020      ; reads at the logical address 0x2020
                         ;   which maps to the same memory as 0xFE1020

    This memory location now also has a global address. For logical 0xFE1020 the global address is 0x0FE020.
    So the following code does once more access the same memory location:

      ORG $7000
        MOVB #0x0F, 0x10 ; GPAGE
        LDAA 0xE020      ; reads at the global address 0x0FE020
                         ;   which maps to the same memory as the logical addr. 0xFE1020

    Therefore every memory location for the HCS12X has up to 3 different addresses.
    Up to two logical and one global.
    Notes.
      - Not every address has a logical equivalent. The external space is only available in the global address space.
        The DMA Registers are also only addressable with global addresses.

      - The PPAGE can only be set if the code is outside of the 0x8000 to 0xBFFF range.
        If not, the next code fetch will be from the new wrong PPAGE value.

      - Inside of the paged area, the highest pages are allocated first. So all HCS12X's do have the FF pages
        (if they have this memory type at all).

      - For RPAGE, the value 0 is illegal. Otherwise the global addresses would overlap with the registers.
        This has the implication that the logical address 0x001000 is strictly seen not valid.


*/


/*--------------------------- pointer conversion operations -------------------------------*/

/*--------------------------- _CONV_GLOBAL_TO_LOGICAL --------------------------------
  Convert 24 bit logical to 24 bit global pointer
    ("char*__far" to "char*__gpage")

  Arguments :
  - B : page part of global address
  - X : 16 offset part of global address

  Postcondition :
  - B == page of returned logical address
  - X == offset of returned logical address
  - Y remains unchanged
  - A remains unchanged
*/
/*--------------------------- Convert 24 bit global to 24 bit logical pointer ----------------------------------*/

/* B:X = Logical(B:X) */
#ifdef __cplusplus
extern "C"
#endif

#pragma NO_FRAME
#pragma NO_ENTRY
#pragma NO_EXIT

void NEAR _CONV_GLOBAL_TO_LOGICAL(void) {
  __asm {
        CMPB    #0x40             ;// flash (0x400000..0x7FFFFF) or not?
        BLO     Below400000
// from 0x400000 to 0x7FFFFF
        CMPB    #0x7F             ;// check for Unpaged areas 0x7FC000..0x7FFFFF and 0x7F4000..0x7F7FFF
        BNE     PAGED_FLASH_AREA
        BITX    #0x4000
        BEQ     PAGED_FLASH_AREA
// from 0x7F4000 to 0x7F7FFF or 0x7FC000 to 0x7FFFFF
                                  ;// Note: offset in X is already OK.
        CLRB                      ;// logical page == 0
        RTS
PAGED_FLASH_AREA:                 ;// paged flash. Map to 0x8000..0xBFFF
// from 0x400000 to 0x7F3FFF  or 0x7F8000 to 0x7FBFFF
        LSLX                      ; // shift 24 bit address 2 bits to the left to get correct page in B
        ROLB
        LSLX
        ROLB
        LSRX                      ; // shift back to get offset from 0x8000 to 0xBFFF
        SEC
        RORX
        RTS                       ;// done

Below400000:
// from 0x000000 to 0x3FFFFF
#if 0 /* How should we handle mapping to External Space. There is no logical equivalent. This is an error case! */
        CMPB    #0x14             ;// check if above 0x140000. If so, its in the external space
        BLO     Below140000
        ERROR   !!!!              ;// this mapping is not possible! What should we do?
        RTS
Below140000:
// from 0x000000 to 0x13FFFF
#endif
        CMPB    #0x10             ;// if >= 0x100000 it's EEPROM
        BLO     Below100000
// from 0x100000 to 0x13FFFF (or 0x3FFFFF)
        CMPB    #0x13             ;// check if its is in the non paged EEPROM area at 0x13FC00..0x13FFFF

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频黄免费的久久| 久久精品国产99国产精品| 久久久久久久网| 日韩欧美中文一区| 日韩视频免费直播| 2021中文字幕一区亚洲| 久久亚洲免费视频| 欧美国产激情二区三区| 亚洲图片你懂的| 亚洲综合一区二区三区| 香蕉成人啪国产精品视频综合网| 一区二区三区成人在线视频| 五月天激情小说综合| 日韩电影一区二区三区四区| 韩国av一区二区三区在线观看| 国产酒店精品激情| 成人a免费在线看| 91麻豆文化传媒在线观看| 欧美日韩在线电影| 日韩一区二区在线观看视频播放| 精品国精品国产尤物美女| 中文字幕av一区二区三区免费看 | 日韩一区二区三区四区五区六区| 欧美肥胖老妇做爰| 欧美tickle裸体挠脚心vk| 中文字幕成人av| 五月天激情小说综合| 国产在线国偷精品产拍免费yy| 91丨porny丨在线| 91精品国产欧美一区二区18| 国产精品色噜噜| 午夜精品一区二区三区电影天堂| 国产盗摄一区二区| 欧美性生活久久| 久久久欧美精品sm网站| 一区二区三区小说| 狠狠v欧美v日韩v亚洲ⅴ| 成人精品视频一区二区三区| 91麻豆精品久久久久蜜臀| 中文字幕巨乱亚洲| 日本不卡一区二区三区高清视频| jlzzjlzz国产精品久久| 欧美日韩国产首页在线观看| 国产精品久久久久久久岛一牛影视 | 成人福利在线看| 欧美丰满少妇xxxbbb| 国产精品乱码一区二区三区软件| 亚洲国产美国国产综合一区二区| 国产精品夜夜嗨| 欧美肥胖老妇做爰| 亚洲精品久久7777| 国产在线不卡一区| 91.com视频| 亚洲一区二区av电影| 成人av网站在线观看免费| 91麻豆精品国产无毒不卡在线观看| 亚洲视频一区在线| 国产精品自在在线| 欧美一区二区三区的| 夜夜嗨av一区二区三区中文字幕 | 一区二区三区自拍| 成人免费视频caoporn| 精品国产欧美一区二区| 蜜臀av一区二区在线免费观看| av在线播放不卡| 国产欧美精品在线观看| 国内精品视频一区二区三区八戒| 欧美一区二区在线看| 亚洲成年人影院| 欧美日韩国产综合一区二区三区 | 黄色精品一二区| 91精品国产一区二区三区| 亚洲一区二区3| 欧美午夜不卡视频| 亚洲国产美国国产综合一区二区| 色婷婷久久一区二区三区麻豆| 日韩毛片精品高清免费| 99精品国产一区二区三区不卡| 国产亚洲精品资源在线26u| 狠狠色狠狠色综合系列| 国产亚洲成aⅴ人片在线观看| 国产精品一区二区在线观看不卡| 精品播放一区二区| 国产精品影视在线观看| 欧美激情一区二区三区| 99国产欧美另类久久久精品| 亚洲欧美偷拍三级| 在线观看视频一区二区| 亚洲gay无套男同| 欧美一级夜夜爽| 国产精品18久久久久| 国产精品免费网站在线观看| 91丝袜美女网| 亚洲福利视频导航| 日韩午夜激情av| 丰满少妇久久久久久久| 一级做a爱片久久| 日韩一区二区在线观看视频| 粉嫩在线一区二区三区视频| 一区二区三区在线免费播放| 日韩欧美不卡在线观看视频| 国产宾馆实践打屁股91| 亚洲伦理在线精品| 91精品国产综合久久久久久| 国产精品一级二级三级| 亚洲国产日韩一区二区| 精品久久久久久综合日本欧美| 成人激情电影免费在线观看| 午夜精品久久久久影视| 国产婷婷精品av在线| 欧美视频一区二区三区四区| 国产露脸91国语对白| 一区二区三区日韩欧美精品| 欧美精品一区二区三区一线天视频| 国产精品996| 午夜精品久久久| 国产精品精品国产色婷婷| 91精品国产综合久久久久久漫画| 99久久99久久精品国产片果冻| 美美哒免费高清在线观看视频一区二区 | 蜜臀久久久99精品久久久久久| 久久久国际精品| 欧美精品久久久久久久久老牛影院| 成人久久18免费网站麻豆| 天天综合天天综合色| 国产精品久久久久久久久晋中| 日韩欧美一二区| 欧美伊人精品成人久久综合97| 国产精品亚洲а∨天堂免在线| 日韩电影在线免费看| 亚洲男同1069视频| 久久精品日产第一区二区三区高清版| 欧美美女直播网站| 91麻豆自制传媒国产之光| 国产激情精品久久久第一区二区 | 精品国产髙清在线看国产毛片| 一本色道综合亚洲| 波多野结衣在线aⅴ中文字幕不卡| 久久成人麻豆午夜电影| 亚洲.国产.中文慕字在线| 亚洲欧美韩国综合色| 国产精品污网站| 国产精品入口麻豆九色| 久久久亚洲国产美女国产盗摄| 91精品国产综合久久精品app| 色噜噜狠狠色综合中国| 日韩精品欧美成人高清一区二区| 成人免费在线视频观看| 国产欧美日产一区| 国产三级欧美三级| 精品三级在线看| 精品国免费一区二区三区| 26uuu国产日韩综合| 91极品视觉盛宴| 亚洲人精品午夜| 日韩av中文字幕一区二区三区| 国产精品一区不卡| 欧美色国产精品| 欧美韩日一区二区三区| 日韩精品每日更新| 成人永久看片免费视频天堂| 欧美日韩一区二区三区四区 | 一区二区三区四区视频精品免费 | 一区二区三区国产精品| 久久99国产精品久久99| 91看片淫黄大片一级在线观看| 日韩三级免费观看| 亚洲精品国产成人久久av盗摄| 久久国产夜色精品鲁鲁99| 在线欧美一区二区| 久久欧美一区二区| 天天免费综合色| 色猫猫国产区一区二在线视频| 精品国产乱码久久久久久久久| 亚洲综合色自拍一区| 99这里只有精品| 精品国产免费一区二区三区四区| 亚洲电影一级片| 色哟哟国产精品免费观看| 欧美国产日韩在线观看| 久久9热精品视频| 欧美人xxxx| 亚洲自拍都市欧美小说| 99久久精品情趣| 国产精品嫩草影院av蜜臀| 国产精品一卡二卡| 精品久久久久久久久久久久久久久久久 | 国产精品久久久久久久蜜臀| 国模一区二区三区白浆| 日韩午夜激情电影| 青青青爽久久午夜综合久久午夜 | 琪琪久久久久日韩精品| 欧美性受xxxx黑人xyx| 亚洲激情图片qvod| 色婷婷综合久久| 亚洲日本va午夜在线影院| 91在线精品一区二区| 亚洲人成精品久久久久| 91农村精品一区二区在线| 1000部国产精品成人观看|