📄 nt68f631_bank.lst
字号:
A51 MACRO ASSEMBLER NT68F631_BANK 12/11/2007 11:28:43 PAGE 1
MACRO ASSEMBLER A51 V7.07
OBJECT MODULE PLACED IN .\BIN\NT68F631_bank.obj
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE SRC\NT68F631_bank.a51 SET(LARGE) DEBUG PRINT(.\LST\NT68F631_bank.lst) OBJE
CT(.\BIN\NT68F631_bank.obj) EP
LOC OBJ LINE SOURCE
1 $nomod51
2 $nocond
3 ;------------------------------------------------------------------------------
4 ; This file is part of the BL51 / L251 Banked Linker/Locater package
5 ; Copyright (c) 1988-1999 Keil Elektronik GmbH and Keil Software, Inc.
6 ; Version 2.0 (Code and Variable Banking for 8051 based Derivatives)
7 ;------------------------------------------------------------------------------
8 ;************************ Configuration Section *******************************
0004 9 ?B_NBANKS EQU 4 ; Define max. Number of Banks *
10 ; ; The following values are allowed: 2, 4, 8, 16, 32 *
11 ; ; the max. value for ?B_BANKS is 32 *
12 ; *
0000 13 ?B_MODE EQU 0 ; 0 for Bank-Switching via 8051 Port *
14 ; ; 1 for Bank-Switching via XDATA Port *
15 ; ; 4 for user-provided bank switch code *
16 ; *
0000 17 ?B_RTX EQU 0 ; 0 for applications without RTX-51 FULL *
18 ; ; 1 for applications using RTX-51 FULL *
19 ; *
0000 20 ?B_VAR_BANKING EQU 0 ; Enable Variable Banking in XDATA and CODE memory *
21 ; ; 0 Variable Banking is disabled *
22 ; ; 1 XDATA and CODE banking with same address lines *
23 ; ; 2 XDATA uses a different banking port *
24 ; *
ENDIF; *
39 ; *
40 IF ?B_MODE = 0; *
41 ;-----------------------------------------------------------------------------*
42 ; if ?BANK?MODE is 0 define the following values *
43 ; For Bank-Switching via 8051 Port define Port Address / Bits *
44 ; *
0090 45 P1 DATA 90H ; I/O Port Address *
46 ; *
0090 47 ?B_PORT EQU P1 ; default is P1 *
0000 48 ?B_FIRSTBIT EQU 0 ; default is Bit 3 *
49 ;-----------------------------------------------------------------------------*
50 ENDIF; *
51 ; *
ENDIF; *
60 ; *
ENDIF; *
99 ; *
100 ;******************************************************************************
101 ; *
102 ; THEORY OF OPERATION *
103 ; ------------------- *
104 ; The section below describes the code generated by BL51 or L251 and the *
105 ; operation of the L51_BANK.A51 module. BL51/L251 generates for each *
106 ; function that is located in a code memory bank and called from the common *
107 ; area or a different code bank and entry into the INTRABANK CALL TABLE. The *
108 ; INTRABANK CALL TABLE is located in the SEGMENT ?BANK?SELECT and listed in *
109 ; the Linker MAP file. The entries in that TABLE have the following format: *
110 ; *
111 ; ?FCT?1: MOV DPTR,#FCT ; Load Address of target FCT *
112 ; JMP ?B_BANKn ; Switch to Bank and Jump to Target Code *
113 ; *
114 ; Instead of directly calling the function FCT, the Linker changes the entry *
A51 MACRO ASSEMBLER NT68F631_BANK 12/11/2007 11:28:43 PAGE 2
115 ; to ?FCT?1. This entry selects the bank where the function FCT is located *
116 ; and calls that function via the routines defined in this L51_BANK.A51 file. *
117 ; The L51_BANK.A51 file contains two sets of functions for each bank: *
118 ; *
119 ; ?B_BANKn is a routine which saves the entry of the ?B_SWITCHn function *
120 ; for the current active bank on the STACK and switches to the *
121 ; bank 'n'. Then it jumps to the address specified by the DPTR *
122 ; register. It is allowed to modify the following registers in *
123 ; the ?B_BANKn routine: A, B, R0, DPTR, PSW *
124 ; *
125 ; ?B_SWITCHn is a function which selects the bank 'n'. This function is *
126 ; used at the end of a user function to return to the calling *
127 ; code bank. Only the following registers may be altered in the *
128 ; ?B_SWITCHn function: R0, DPTR *
129 ; *
130 ; The current active bank is stored in ?B_CURRENTBANK. RTX-51 uses this *
131 ; variable to restore the code bank after a task switch. To get correct *
132 ; results, ?B_CURRENTBANK must be set to the code bank before the hardware *
133 ; switch is done, or the code banking sequences must be interrupt protected. *
134 ;******************************************************************************
135
136 NAME ?BANK?SWITCHING
137
138 PUBLIC ?B_NBANKS, ?B_MODE, ?B_CURRENTBANK, ?B_MASK
139 PUBLIC ?B_FACTOR
140
141 ; Standard SFR Symbols required in L51_BANK.A51
00E0 142 ACC DATA 0E0H
00F0 143 B DATA 0F0H
0082 144 DPL DATA 82H
0083 145 DPH DATA 83H
146
147
148 ; generate Mask and Bank Number Information
ELSEIF ?B_NBANKS <= 4
0003 152 MASK EQU 00000011B
ENDIF
160
161 IF ?B_MODE = 0 ;**************************************************************
162
0001 163 ?B_FACTOR EQU 1 SHL ?B_FIRSTBIT
164
0003 165 ?B_MASK EQU MASK SHL ?B_FIRSTBIT
166
167 BANKN MACRO N
168 BANK&N EQU N SHL ?B_FIRSTBIT
169 ENDM
170
0000 171 CNT SET 0
172
173 REPT ?B_NBANKS
174 BANKN %CNT
175 CNT SET CNT+1
176 ENDM
177+1 BANKN %CNT
180+1 BANKN %CNT
183+1 BANKN %CNT
186+1 BANKN %CNT
189
190
0090 191 ?B_CURRENTBANK EQU ?B_PORT
192
193 ; Convert Bank No in Accu to Address * 8
194
195 IF ?B_FIRSTBIT = 0
196 CONVBANKNO MACRO
A51 MACRO ASSEMBLER NT68F631_BANK 12/11/2007 11:28:43 PAGE 3
197 SWAP A
198 RR A
199 ENDM
200 ENDIF
201
ENDIF
208
ENDIF
214
ENDIF
219
ENDIF
225
ENDIF
232
ENDIF
239
ENDIF
245
246
247 SELECT MACRO N
248 LOCAL XLABEL, YLABEL
249
250 PUBLIC ?B_BANK&N
251 ?B_BANK&N:
252 MOV A,?B_CURRENTBANK
253 ANL A,#?B_MASK
254 ;; CJNE A,#BANK&N,XLABEL
255 ;; CLR A
256 ;; JMP @A+DPTR
257 ;;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -