📄 systemtimerint.lst
字号:
17 ; ******** Define Memory Model and Stack parameters ********
18 ;
19 0001 IMAGECRAFT: equ 1
20 0002 HITECH: equ 2
21 0002 TOOLCHAIN: equ HITECH
22 0001 SYSTEM_LARGE_MEMORY_MODEL: equ 1
23 0000 SYSTEM_SMALL_MEMORY_MODEL: equ 0
24 0001 SYSTEM_STACK_PAGE: equ 1
25 0000 SYSTEM_STACK_PAGE_OFFSET: equ 0
26 0002 SYSTEM_TOOLS: equ 2
27 0000 SYSTEM_IDXPG_TRACKS_STK_PP: equ 0
28 0001 SYSTEM_IDXPG_TRACKS_IDX_PP: equ 1
29 0000 SYSTEM_MULTIPAGE_STACK: equ 0
30
31
32 ; ******* Function Class Definitions *******
33 ;
34 ; These definitions are used to describe RAM access patterns. They provide
35 ; documentation and they control prologue and epilogue macros that perform
36 ; the necessary housekeeping functions for large memory model devices like
37 ; the CY8C27x66 and CY8C29x66.
38
39 0001 RAM_USE_CLASS_1: equ 1 ; PUSH, POP & I/O access
40 0002 RAM_USE_CLASS_2: equ 2 ; Indexed address mode on stack page
41 0004 RAM_USE_CLASS_3: equ 4 ; Indexed address mode to any page
42 0008 RAM_USE_CLASS_4: equ 8 ; Direct/Indirect address mode access
43
44
45 ; ******* Page Pointer Manipulation Macros *******
46 ;
47 ; Most of the following macros are conditionally compiled so they only
48 ; produce code if the large memory model is selected.
49
50 ;-----------------------------------------------
51 ; Set Stack Page Macro
52 ;-----------------------------------------------
53 ;
54 ; DESC: Modify STK_PP in the large or small memory Models.
55 ;
56 ; INPUT: Constant (e.g., SYSTEM_STACK_PAGE) that specifies the RAM page on
57 ; which stack operations like PUSH and POP store and retrieve their
58 ; data
59 ;
60 ; COST: 8 instruction cycles (in LMM only)
61
62 macro RAM_SETPAGE_STK( PG_NUMBER )
63 IF ( SYSTEM_LARGE_MEMORY_MODEL )
64 mov reg[STK_PP], @PG_NUMBER
65 ENDIF
66 1C5C endm
67
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 1C5C 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 1C5C 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 1C5C 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 1C5C 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 1C5C 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 1C5C 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -