📄 bit_reverse.lst
字号:
144 1 BMOV R2.3,R3.2 ;bit reverse
145 1 BMOV R2.2,R3.3 ;bit reverse
146 1 BMOV R2.1,R3.4 ;bit reverse
147 1 BMOV R2.0,R3.5 ;bit reverse
148 1 MOV [X],R2 ;x[i]=(R2)
149 1 MOV R2,[X+] ;increase the address
150 1 SUB N,#1 ;(N)=(N)-1
151 1 JMPR cc_NZ,loop6 ;if (N)>0, jump
152 1
153 1 RET
154 1
155 1 //if N=128, 7 bits
156 1 Neq7:
157 1 CMP R2,#7
158 1 JMPR cc_NE,Neq8 ;if (R2) not equal to 7, jump
159 1 loop7:
160 1 MOV R3,[X] ;(R3)=x[i]
161 1 MOV R2,R3 ;(R2)=(R3)
162 1 BMOV R2.6,R3.0 ;bit reverse
163 1 BMOV R2.5,R3.1 ;bit reverse
164 1 BMOV R2.4,R3.2 ;bit reverse
165 1 BMOV R2.2,R3.4 ;bit reverse
166 1 BMOV R2.1,R3.5 ;bit reverse
167 1 BMOV R2.0,R3.6 ;bit reverse
168 1 MOV [X],R2 ;x[i]=(R2)
169 1 MOV R2,[X+] ;increase the address
170 1 SUB N,#1 ;(N)=(N)-1
171 1 JMPR cc_NZ,loop7 ;if (N)>0, jump
172 1
173 1 RET
174 1
175 1 //if N=256, 8 bits
176 1 Neq8:
177 1 CMP R2,#8
178 1 JMPR cc_NE,Neq9 ;if (R2) not equal to 8, jump
179 1 loop8:
C166 COMPILER V6.04, BIT_REVERSE 09/04/2007 16:24:44 PAGE 4
180 1 MOV R3,[X] ;(R3)=x[i]
181 1 MOV R2,R3 ;(R2)=(R3)
182 1 BMOV R2.7,R3.0 ;bit reverse
183 1 BMOV R2.6,R3.1 ;bit reverse
184 1 BMOV R2.5,R3.2 ;bit reverse
185 1 BMOV R2.4,R3.3 ;bit reverse
186 1 BMOV R2.3,R3.4 ;bit reverse
187 1 BMOV R2.2,R3.5 ;bit reverse
188 1 BMOV R2.1,R3.6 ;bit reverse
189 1 BMOV R2.0,R3.7 ;bit reverse
190 1 MOV [X],R2 ;x[i]=(R2)
191 1 MOV R2,[X+] ;increase the address
192 1 SUB N,#1 ;(N)=(N)-1
193 1 JMPR cc_NZ,loop8 ;if (N)>0, jump
194 1
195 1 RET
196 1 //if N=512, 9 bits
197 1 Neq9:
198 1 CMP R2,#9
199 1 JMPR cc_NE,Neq10 ;if (R2) not equal to 9, jump
200 1 loop9:
201 1 MOV R3,[X] ;(R3)=x[i]
202 1 MOV R2,R3 ;(R2)=(R3)
203 1 BMOV R2.8,R3.0 ;bit reverse
204 1 BMOV R2.7,R3.1 ;bit reverse
205 1 BMOV R2.6,R3.2 ;bit reverse
206 1 BMOV R2.5,R3.3 ;bit reverse
207 1 BMOV R2.3,R3.5 ;bit reverse
208 1 BMOV R2.2,R3.6 ;bit reverse
209 1 BMOV R2.1,R3.7 ;bit reverse
210 1 BMOV R2.0,R3.8 ;bit reverse
211 1 MOV [X],R2 ;x[i]=(R2)
212 1 MOV R2,[X+] ;increase the address
213 1 SUB N,#1 ;(N)=(N)-1
214 1 JMPR cc_NZ,loop9 ;if (N)>0, jump
215 1
216 1 RET
217 1
218 1 //if N=1024, 10 bits
219 1 Neq10:
220 1 CMP R2,#10
221 1 JMPR cc_NE,Neq11 ;if (R2) not equal to 10, jump
222 1 loop10:
223 1 MOV R3,[X] ;(R3)=x[i]
224 1 MOV R2,R3 ;(R2)=(R3)
225 1 BMOV R2.9,R3.0 ;bit reverse
226 1 BMOV R2.8,R3.1 ;bit reverse
227 1 BMOV R2.7,R3.2 ;bit reverse
228 1 BMOV R2.6,R3.3 ;bit reverse
229 1 BMOV R2.5,R3.4 ;bit reverse
230 1 BMOV R2.4,R3.5 ;bit reverse
231 1 BMOV R2.3,R3.6 ;bit reverse
232 1 BMOV R2.2,R3.7 ;bit reverse
233 1 BMOV R2.1,R3.8 ;bit reverse
234 1 BMOV R2.0,R3.9 ;bit reverse
235 1 MOV [X],R2 ;x[i]=(R2)
236 1 MOV R2,[X+] ;increase the address
237 1 SUB N,#1 ;(N)=(N)-1
238 1 JMPR cc_NZ,loop10 ;if (N)>0, jump
239 1
240 1 RET
241 1
C166 COMPILER V6.04, BIT_REVERSE 09/04/2007 16:24:44 PAGE 5
242 1 //if N=2048, 11 bits
243 1 Neq11:
244 1 CMP R2,#11
245 1 JMPR cc_NE,Neq12 ;if (R2) not equal to 11, jump
246 1 loop11:
247 1 MOV R3,[X] ;(R3)=x[i]
248 1 MOV R2,R3 ;(R2)=(R3)
249 1 BMOV R2.10,R3.0 ;bit reverse
250 1 BMOV R2.9,R3.1 ;bit reverse
251 1 BMOV R2.8,R3.2 ;bit reverse
252 1 BMOV R2.7,R3.3 ;bit reverse
253 1 BMOV R2.6,R3.4 ;bit reverse
254 1 BMOV R2.4,R3.6 ;bit reverse
255 1 BMOV R2.3,R3.7 ;bit reverse
256 1 BMOV R2.2,R3.8 ;bit reverse
257 1 BMOV R2.1,R3.9 ;bit reverse
258 1 BMOV R2.0,R3.10 ;bit reverse
259 1 MOV [X],R2 ;x[i]=(R2)
260 1 MOV R2,[X+] ;increase the address
261 1 SUB N,#1 ;(N)=(N)-1
262 1 JMPR cc_NZ,loop11;if (N)>0, jump
263 1
264 1 RET
265 1
266 1 Neq12:
267 1
268 1 RET
269 1
270 1 }
271 1 }
272 //------------------- END OF FILE ----------------------------------------------
273
MODULE INFORMATION: INITIALIZED UNINITIALIZED
CODE SIZE = 452 --------
NEAR-CONST SIZE = -------- --------
FAR-CONST SIZE = -------- --------
HUGE-CONST SIZE = -------- --------
XHUGE-CONST SIZE = -------- --------
NEAR-DATA SIZE = -------- --------
FAR-DATA SIZE = -------- --------
XHUGE-DATA SIZE = -------- --------
IDATA-DATA SIZE = -------- --------
SDATA-DATA SIZE = -------- --------
BDATA-DATA SIZE = -------- --------
HUGE-DATA SIZE = -------- --------
BIT SIZE = -------- --------
INIT'L SIZE = -------- --------
END OF MODULE INFORMATION.
C166 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -