⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 i2chwrsrcinits.lst

📁 cpress器件实现触摸按键程序.开发环境PsOC Designer
💻 LST
📖 第 1 页 / 共 5 页
字号:
    68                             ;-----------------------------------------------
    69                             ;  Set Current Page Macro
    70                             ;-----------------------------------------------
    71                             ;
    72                             ;  DESC: Modify CUR_PP in the large or small memory Models.
    73                             ;
    74                             ; INPUT: Constant value (e.g., >bFoo) for the RAM page number used in
    75                             ;        calculation of effective direct-mode address operands.
    76                             ;
    77                             ;  COST: 8 instruction cycles (in LMM only)
    78                          
    79                             macro RAM_SETPAGE_CUR( PG_NUMBER )
    80                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
    81                                mov reg[CUR_PP], @PG_NUMBER
    82                             ENDIF
    83  1E64                       endm
    84                          
    85                             ;-----------------------------------------------
    86                             ;  Set Index Page Macro
    87                             ;-----------------------------------------------
    88                             ;
    89                             ;  DESC: Modify IDX_PP in the large or small emory Models.
    90                             ;
    91                             ; INPUT: Constant value (e.g., >caFoo) for the RAM page number used in
    92                             ;         calculation of effective index-mode address operands.
    93                             ;
    94                             ;  COST: 8 instruction cycles (in LMM only)
    95                          
    96                             macro RAM_SETPAGE_IDX( PG_NUMBER )
    97                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
    98                                mov reg[IDX_PP], @PG_NUMBER
    99                             ENDIF
   100  1E64                       endm
   101                          
   102                             ;-----------------------------------------------
   103                             ;  Set MVI Read Page Macro
   104                             ;-----------------------------------------------
   105                             ;
   106                             ;  DESC: Modify MVR_PP in the large or small memory Models.
   107                             ;
   108                             ; INPUT: Constant value (e.g., >pFoo) for the RAM page number used in
   109                             ;        calculation of indirect address operands used in the
   110                             ;        "mvi A, [pFoo]" instructions.
   111                             ;
   112                             ;  COST: 8 instruction cycles (in LMM only)
   113                          
   114                             macro RAM_SETPAGE_MVR( PG_NUMBER )
   115                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   116                                mov reg[MVR_PP], @PG_NUMBER
   117                             ENDIF
   118  1E64                       endm
   119                          
   120                             ;-----------------------------------------------
   121                             ;  Set MVI Write Page Macro
   122                             ;-----------------------------------------------
   123                             ;
   124                             ;  DESC: Modify MVW_PP in the large or small memory Models.
   125                             ;
   126                             ; INPUT: Constant value (e.g., >pFoo) for the RAM page number used in
   127                             ;        calculation of indirect address operands used in the
   128                             ;        "mvi [pFoo], A" instructions.
   129                             ;
   130                             ;  COST: 8 instruction cycles (in LMM only)
   131                          
   132                             macro RAM_SETPAGE_MVW( PG_NUMBER )
   133                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   134                                mov reg[MVW_PP], @PG_NUMBER
   135                             ENDIF
   136  1E64                       endm
   137                          
   138                             ;-----------------------------------------------
   139                             ;  Force Index Page Pointer to Stack Page
   140                             ;-----------------------------------------------
   141                             ;
   142                             ;  DESC: Map index-mode operands onto the stack page by modifying IDX_PP.
   143                             ;        See also RAM_LOCK_INDEX_TO_STACKPAGE.
   144                             ;
   145                             ; INPUT: None
   146                             ;
   147                             ;  COST: 8 instruction cycles (in LMM only)
   148                          
   149                             macro RAM_SETPAGE_IDX2STK
   150                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   151                                IF ( SYSTEM_MULTIPAGE_STACK )
   152                                   mov   A, reg[STK_PP]
   153                                   mov   reg[IDX_PP], A
   154                                ELSE
   155                                   RAM_SETPAGE_IDX SYSTEM_STACK_PAGE
   156                                ENDIF
   157                             ENDIF
   158  1E64                       endm
   159                          
   160                             ;-----------------------------------------------
   161                             ;  Change Memory Mode
   162                             ;-----------------------------------------------
   163                             ;
   164                             ;  DESC: Modify FLAG_PAGEMODE bits in the large and small memory Models.
   165                             ;
   166                             ; INPUT: Constant value for PGMODE bitfield of CPU Flag register, F.
   167                             ;        See FLAG_PGMODE_{x} constants in M8C.INC.
   168                             ;
   169                             ;  COST: 8 instruction cycles (in LMM only)
   170                          
   171                             macro RAM_CHANGE_PAGE_MODE( MODE )
   172                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   173                                and   F, ~FLAG_PGMODE_MASK        ; NOTE: transition thru 00b state
   174                                or    F,  FLAG_PGMODE_MASK & @MODE
   175                             ENDIF
   176  1E64                       endm
   177                          
   178                             ;-----------------------------------------------
   179                             ;  Set Large Memory Model Native Paging Mode
   180                             ;-----------------------------------------------
   181                             ;
   182                             ;  DESC: Changes the FLAG_PAGEMODE bits to enter the native LMM RAM
   183                             ;        paging mode *IFF* a simple "OR" is guaranteed to work---for
   184                             ;        example, in an ISR, when the PGMODE bits have been cleared
   185                             ;        to zero. If a simple "OR" is not guaranteed to work, use
   186                             ;        the slower RAM_RESTORE_NATIVE_PAGING instead.
   187                             ;
   188                             ; INPUT: none
   189                             ;
   190                             ;  COST: 4 instruction cycles (in LMM only)
   191                          
   192                             macro RAM_SET_NATIVE_PAGING
   193                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   194                             IF ( SYSTEM_IDXPG_TRACKS_STK_PP )
   195                                or    F,  FLAG_PGMODE_11b            ; LMM w/ IndexPage<==>StackPage
   196                             ENDIF ;  PGMODE LOCKED
   197                             IF ( SYSTEM_IDXPG_TRACKS_IDX_PP )
   198                                or    F,  FLAG_PGMODE_10b            ; LMM with independent IndexPage
   199                             ENDIF ; PGMODE FREE
   200                             ENDIF ; SYSTEM_LARGE_MEMORY_MODEL
   201  1E64                       endm
   202                          
   203                             ;-----------------------------------------------
   204                             ; Restore Large Memory Model Native Paging Mode
   205                             ;-----------------------------------------------
   206                             ;
   207                             ;  DESC: Changes the FLAG_PAGEMODE bits to enter the native LMM RAM
   208                             ;        paging mode. Always works because it clears the PGMODE bits
   209                             ;        before OR-ing in the new ones. See RAM_RESTORE_NATIVE_PAGING
   210                             ;        for a faster method.
   211                             ;
   212                             ; INPUT: none
   213                             ;
   214                             ;  COST: 8 instruction cycles (in LMM only)
   215                          
   216                             macro RAM_RESTORE_NATIVE_PAGING
   217                             IF ( SYSTEM_LARGE_MEMORY_MODEL )
   218                             IF ( SYSTEM_IDXPG_TRACKS_STK_PP )
   219                                RAM_CHANGE_PAGE_MODE FLAG_PGMODE_11b ; LMM w/ IndexPage<==>StackPage
   220                             ENDIF ;  PGMODE LOCKED
   221                             IF ( SYSTEM_IDXPG_TRACKS_IDX_PP )
   222                                RAM_CHANGE_PAGE_MODE FLAG_PGMODE_10b ; LMM with independent IndexPage
   223                             ENDIF ; PGMODE FREE
   224                             ENDIF ; SYSTEM_LARGE_MEMORY_MODEL
   225  1E64                       endm
   226                          
   227                             ;-----------------------------------------------
   228                             ; Force indexed addr mode operands to Stack Pg
   229                             ;-----------------------------------------------
   230                             ;
   231                             ;  DESC: Force instructions that use indexed address mode to reference the
   232                             ;        stack page (as defined by STK_PP). This macro sets the "Indexed
   233                             ;        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -