红色字体为出错提示,都是在调用函数时出错。
MPASM 5.20 PIC.ASM 10-9-2009 10:55:46 PAGE 2
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0016 0586 00050 BSF RB,4
0017 0506 00051 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)0018 095B 00052 CALL DELAY 00053
0019 0486 00054 BCF RB,4
001A 0406 00055 BCF RB,0
001B 0000 00056 NOP
00057
001C 0C00 00058 MOVLW 00H
001D 0033 00059 MOVWF U1
00060
001E 0C00 00061 MOVLW 00H
001F 0034 00062 MOVWF D1
00063
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0020 0964 00064 CALL send8 00065
0021 0586 00066 BSF RB,4
0022 0506 00067 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0023 095B 00068 CALL DELAY
00069
0024 0486 00070 BCF RB,4
0025 0406 00071 BCF RB,0
0026 0000 00072 NOP
00073
0027 0CA0 00074 MOVLW 0A0H
0028 0033 00075 MOVWF U1
00076
0029 0CA0 00077 MOVLW 0A0H
002A 0034 00078 MOVWF D1
00079
Error[120] : Call or jump not allowed at this address (must be in low half of page)
002B 0964 00080 CALL send8
00081
002C 0586 00082 BSF RB,4
002D 0506 00083 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
002E 095B 00084 CALL DELAY
00085
002F 0486 00086 BCF RB,4
你程序中的call有问题啊 !不过还没遇到过你这种问题呢 头一次见
1.注意microchip的系列单片机,ROM分块bank,或者翻译成扇区,调用别的扇区的函数不能直接用call。
所以写代码的时候要注意,最好将调用语句和函数头放在同一个bank中。
2。这是microchip最不好的设计之一,所以它的衍生后来者都去掉这一点,比如holtek,tenx等类microchip产品。
引用: 引用 3 楼 duojinian 的回复:
1.注意microchip的系列单片机,ROM分块bank,或者翻译成扇区,调用别的扇区的函数不能直接用call。
所以写代码的时候要注意,最好将调用语句和函数头放在同一个bank中。
2。这是microchip最不好的设计之一,所以它的衍生后来者都去掉这一点,比如holtek,tenx等类microchip产品。
我也试着将调用语句和函数头放在同一个bank中了,但编译时,前面0000~00FF的调用都正确,0100后面的调用还是出错
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00001 ;**********************************************************************
00002 ; 用于测试的样机 器件 PIC16F54
00003 ; *
00004 ;**********************************************************************
00005 ; *
00006 ; Filename: PIC16F54.asm *
00007 ; Date: 2009.10.09 *
00008 ; File Version: V1.0 *
00009 ; *
00010 ; Author: brand *
00011 ; Company: Watts *
00012 ; *
00013 ;**********************************************************************
00014 ; U 上行参数 D下行参数
00015 ;**********************************************************************
00016
00017
00018 list p=16F54
00019 #include
00001 LIST
00002 ; P16F5X.INC Standard Header File, Version 4.00 Microchip Technology, Inc.
00128 LIST
00020
0FFF 0FFF 00021 __CONFIG _CP_OFF & _WDT_ON & _RC_OSC
00022
00000010 00023 count EQU 10H
00000011 00024 count1 EQU 11H
00025
00000005 00026 RA EQU 5H
00000006 00027 RB EQU 6H
00000007 00028 RC EQU 7H
00029
00000013 00030 U1 EQU 13H
00000014 00031 D1 EQU 14H
00032
00033
01FF 00034 ORG 0x1FF
01FF 0A10 00035 goto start
0010 00036 ORG 0x0010
00037
00038
0010 00039 start
0010 0C88 00040 MOVLW 88H
0011 0006 00041 TRIS RB
00042
0012 0CFF 00043 MOVLW 0FFH
0013 0026 00044 MOVWF RB
00045
0014 0C0F 00046 MOVLW 0FH
0015 0002 00047 OPTION
00048
00049
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 2
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0016 0586 00050 BSF RB,4
0017 0506 00051 BSF RB,0
0018 09E8 00052 CALL DELAY
00053
0019 0486 00054 BCF RB,4
001A 0406 00055 BCF RB,0
001B 0000 00056 NOP
00057
001C 0C00 00058 MOVLW 00H
001D 0033 00059 MOVWF U1
00060
001E 0C00 00061 MOVLW 00H
001F 0034 00062 MOVWF D1
00063
0020 09F1 00064 CALL send8
00065
0021 0586 00066 BSF RB,4
0022 0506 00067 BSF RB,0
0023 09E8 00068 CALL DELAY
00069
0024 0486 00070 BCF RB,4
0025 0406 00071 BCF RB,0
0026 0000 00072 NOP
00073
0027 0CA0 00074 MOVLW 0A0H
0028 0033 00075 MOVWF U1
00076
0029 0CA0 00077 MOVLW 0A0H
002A 0034 00078 MOVWF D1
00079
002B 09F1 00080 CALL send8
00081
002C 0586 00082 BSF RB,4
002D 0506 00083 BSF RB,0
002E 09E8 00084 CALL DELAY
00085
002F 0486 00086 BCF RB,4
0030 0406 00087 BCF RB,0
0031 0000 00088 NOP
00089
0032 0C01 00090 MOVLW 001H
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 3
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
-------
0033 0033 00091 MOVWF U1
00092
0034 0C01 00093 MOVLW 001H
0035 0034 00094 MOVWF D1
00095
0036 09F1 00096 CALL send8
00097
0037 0000 00098 NOP
0038 09E8 00099 CALL DELAY
00100
0039 0586 00101 BSF RB,4
003A 0506 00102 BSF RB,0
003B 09E8 00103 CALL DELAY
00104
003C 0486 00105 BCF RB,4
003D 0406 00106 BCF RB,0
003E 0000 00107 NOP
00108
003F 0C01 00109 MOVLW 01H
0040 0033 00110 MOVWF U1
00111
0041 0C01 00112 MOVLW 01H
0042 0034 00113 MOVWF D1
00114
0043 09F1 00115 CALL send8
00116
0044 0586 00117 BSF RB,4
0045 0506 00118 BSF RB,0
0046 09E8 00119 CALL DELAY
00120
0047 0486 00121 BCF RB,4
0048 0406 00122 BCF RB,0
0049 0000 00123 NOP
00124
004A 0C90 00125 MOVLW 90H
004B 0033 00126 MOVWF U1
00127
004C 0C90 00128 MOVLW 90H
004D 0034 00129 MOVWF D1
00130
004E 09F1 00131 CALL send8
00132
004F 0586 00133 BSF RB,4
0050 0506 00134 BSF RB,0
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 3
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
-------
0033 0033 00091 MOVWF U1
00092
0034 0C01 00093 MOVLW 001H
0035 0034 00094 MOVWF D1
00095
0036 09F1 00096 CALL send8
00097
0037 0000 00098 NOP
0038 09E8 00099 CALL DELAY
00100
0039 0586 00101 BSF RB,4
003A 0506 00102 BSF RB,0
003B 09E8 00103 CALL DELAY
00104
003C 0486 00105 BCF RB,4
003D 0406 00106 BCF RB,0
003E 0000 00107 NOP
00108
003F 0C01 00109 MOVLW 01H
0040 0033 00110 MOVWF U1
00111
0041 0C01 00112 MOVLW 01H
0042 0034 00113 MOVWF D1
00114
0043 09F1 00115 CALL send8
00116
0044 0586 00117 BSF RB,4
0045 0506 00118 BSF RB,0
0046 09E8 00119 CALL DELAY
00120
0047 0486 00121 BCF RB,4
0048 0406 00122 BCF RB,0
0049 0000 00123 NOP
00124
004A 0C90 00125 MOVLW 90H
004B 0033 00126 MOVWF U1
00127
004C 0C90 00128 MOVLW 90H
004D 0034 00129 MOVWF D1
00130
004E 09F1 00131 CALL send8
00132
004F 0586 00133 BSF RB,4
0050 0506 00134 BSF RB,0
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 4
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
-----------------
0051 09E8 00135 CALL DELAY
00136
0052 0486 00137 BCF RB,4
0053 0406 00138 BCF RB,0
0054 0000 00139 NOP
00140
0055 0C7E 00141 MOVLW 7EH
0056 0033 00142 MOVWF U1
00143
0057 0C7E 00144 MOVLW 7EH
0058 0034 00145 MOVWF D1
00146
0059 09F1 00147 CALL send8
00148
005A 0000 00149 NOP
005B 09E8 00150 CALL DELAY
00151
005C 0586 00152 BSF RB,4
005D 0506 00153 BSF RB,0
005E 09E8 00154 CALL DELAY
00155
005F 0486 00156 BCF RB,4
0060 0406 00157 BCF RB,0
0061 0000 00158 NOP
00159
0062 0C02 00160 MOVLW 02H
0063 0033 00161 MOVWF U1
00162
0064 0C02 00163 MOVLW 02H
0065 0034 00164 MOVWF D1
00165
0066 09F1 00166 CALL send8
00167
0067 0586 00168 BSF RB,4
0068 0506 00169 BSF RB,0
0069 09E8 00170 CALL DELAY
00171
006A 0486 00172 BCF RB,4
006B 0406 00173 BCF RB,0
006C 0000 00174 NOP
00175
006D 0C3B 00176 MOVLW 3BH
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 5
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
------
006E 0033 00177 MOVWF U1
00178
006F 0C3B 00179 MOVLW 3BH
0070 0034 00180 MOVWF D1
00181
0071 09F1 00182 CALL send8
00183
0072 0586 00184 BSF RB,4
0073 0506 00185 BSF RB,0
0074 09E8 00186 CALL DELAY
00187
0075 0486 00188 BCF RB,4
0076 0406 00189 BCF RB,0
0077 0000 00190 NOP
00191
0078 0C88 00192 MOVLW 88H
0079 0033 00193 MOVWF U1
00194
007A 0C88 00195 MOVLW 88H
007B 0034 00196 MOVWF D1
00197
007C 09F1 00198 CALL send8
00199
007D 0000 00200 NOP
007E 09E8 00201 CALL DELAY
00202
007F 0586 00203 BSF RB,4
0080 0506 00204 BSF RB,0
0081 09E8 00205 CALL DELAY
00206
0082 0486 00207 BCF RB,4
0083 0406 00208 BCF RB,0
0084 0000 00209 NOP
00210
0085 0C03 00211 MOVLW 03H
0086 0033 00212 MOVWF U1
00213
0087 0C03 00214 MOVLW 03H
0088 0034 00215 MOVWF D1
00216
0089 09F1 00217 CALL send8 ;
00218
008A 0586 00219 BSF RB,4
008B 0506 00220 BSF RB,0
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 6
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
-----------------
008C 09E8 00221 CALL DELAY
00222
008D 0486 00223 BCF RB,4
008E 0406 00224 BCF RB,0
008F 0000 00225 NOP
00226
0090 0CCD 00227 MOVLW 0CDH
0091 0033 00228 MOVWF U1
00229
0092 0CCD 00230 MOVLW 0CDH
0093 0034 00231 MOVWF D1
00232
0094 09F1 00233 CALL send8
00234
0095 0586 00235 BSF RB,4
0096 0506 00236 BSF RB,0
0097 09E8 00237 CALL DELAY
00238
0098 0486 00239 BCF RB,4
0099 0406 00240 BCF RB,0
009A 0000 00241 NOP
00242
009B 0CDC 00243 MOVLW 0DCH
009C 0033 00244 MOVWF U1
00245
009D 0CDC 00246 MOVLW 0DCH
009E 0034 00247 MOVWF D1
00248
009F 09F1 00249 CALL send8
00250
00A0 0000 00251 NOP
00A1 09E8 00252 CALL DELAY
00253
00A2 0586 00254 BSF RB,4
00A3 0506 00255 BSF RB,0
00A4 09E8 00256 CALL DELAY
00257
00A5 0486 00258 BCF RB,4
00A6 0406 00259 BCF RB,0
00A7 0000 00260 NOP
00261
00A8 0C05 00262 MOVLW 05H
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 7
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
---------
00A9 0033 00263 MOVWF U1
00264
00AA 0C05 00265 MOVLW 05H
00AB 0034 00266 MOVWF D1
00267
00AC 09F1 00268 CALL send8 ;
00269
00AD 0586 00270 BSF RB,4
00AE 0506 00271 BSF RB,0
00AF 09E8 00272 CALL DELAY
00273
00B0 0486 00274 BCF RB,4
00B1 0406 00275 BCF RB,0
00B2 0000 00276 NOP
00277
00B3 0C0D 00278 MOVLW 0DH
00B4 0033 00279 MOVWF U1
00280
00B5 0C0D 00281 MOVLW 0DH
00B6 0034 00282 MOVWF D1
00283
00B7 09F1 00284 CALL send8
00285
00B8 0586 00286 BSF RB,4
00B9 0506 00287 BSF RB,0
00BA 09E8 00288 CALL DELAY
00289
00BB 0486 00290 BCF RB,4
00BC 0406 00291 BCF RB,0
00BD 0000 00292 NOP
00293
00BE 0C88 00294 MOVLW 88H
00BF 0033 00295 MOVWF U1
00296
00C0 0C88 00297 MOVLW 88H
00C1 0034 00298 MOVWF D1
00299
00C2 09F1 00300 CALL send8
00301
00C3 0000 00302 NOP
00C4 09E8 00303 CALL DELAY
00304
00C5 0586 00305 BSF RB,4
00C6 0506 00306 BSF RB,0
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 8
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
-----------------
00C7 09E8 00307 CALL DELAY
00308
00C8 0486 00309 BCF RB,4
00C9 0406 00310 BCF RB,0
00CA 0000 00311 NOP
00312
00CB 0C06 00313 MOVLW 06H
00CC 0033 00314 MOVWF U1
00315
00CD 0C06 00316 MOVLW 06H
00CE 0034 00317 MOVWF D1
00318
00CF 09F1 00319 CALL send8 ;
00320
00D0 0586 00321 BSF RB,4
00D1 0506 00322 BSF RB,0
00D2 09E8 00323 CALL DELAY
00324
00D3 0486 00325 BCF RB,4
00D4 0406 00326 BCF RB,0
00D5 0000 00327 NOP
00328
00D6 0C48 00329 MOVLW 48H
00D7 0033 00330 MOVWF U1
00331
00D8 0C48 00332 MOVLW 48H
00D9 0034 00333 MOVWF D1
00334
00DA 09F1 00335 CALL send8
00336
00DB 0586 00337 BSF RB,4
00DC 0506 00338 BSF RB,0
00DD 09E8 00339 CALL DELAY
00340
00DE 0486 00341 BCF RB,4
00DF 0406 00342 BCF RB,0
00E0 0000 00343 NOP
00344
00E1 0CF1 00345 MOVLW 0F1H
00E2 0033 00346 MOVWF U1
00347
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 9
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00E3 0CF1 00348 MOVLW 0F1H
00E4 0034 00349 MOVWF D1
00350
00E5 09F1 00351 CALL send8
00352
00E6 0000 00353 NOP
00E7 09E8 00354 CALL DELAY
00355
00356
00357
00E8 0CFF 00358 DELAY MOVLW 0FFH
00E9 0030 00359 MOVWF count
00360
00EA 0CFF 00361 L10 MOVLW 0FFH
00EB 0031 00362 MOVWF count1
00363
00EC 02F1 00364 L20 DECFSZ count1,1
00ED 0AEC 00365 GOTO L20
00366
00EE 02F0 00367 DECFSZ count,1
00EF 0AEA 00368 GOTO L10
00369
00F0 0800 00370 RETLW 0
00371
00F1 00372 send8
00F1 0C08 00373 MOVLW 8
00F2 0030 00374 MOVWF count
00F3 00375 LOOP0
00F3 06F3 00376 BTFSC U1,7
00F4 0526 00377 BSF RB,1
00F5 07F3 00378 BTFSS U1,7
00F6 0426 00379 BCF RB,1
00380
00F7 06F4 00381 BTFSC D1,7
00F8 05A6 00382 BSF RB,5
00F9 07F4 00383 BTFSS D1,7
00FA 04A6 00384 BCF RB,5
00385
00FB 0000 00386 NOP
00387
00FC 04C6 00388 BCF RB,6
00FD 0446 00389 BCF RB,2
00FE 0000 00390 NOP
00FF 0000 00391 NOP
0100 0000 00392 NOP
00393
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 10
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0101 05C6 00394 BSF RB,6
0102 0546 00395 BSF RB,2
0103 0000 00396 NOP
00397
0104 0373 00398 RLF U1,1
0105 0374 00399 RLF D1,1
00400
0106 02F0 00401 DECFSZ count,1
0107 0AF3 00402 GOTO LOOP0
00403
0108 0800 00404 RETLW 0
00405
0109 0586 00406 BSF RB,4
010A 0506 00407 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
010B 097B 00408 CALL DELAY1
00409
010C 0486 00410 BCF RB,4
010D 0406 00411 BCF RB,0
010E 0000 00412 NOP
00413
010F 0C07 00414 MOVLW 07H
0110 0033 00415 MOVWF U1
00416
0111 0C07 00417 MOVLW 07H
0112 0034 00418 MOVWF D1
00419
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0113 0984 00420 CALL send81 ;
00421
0114 0586 00422 BSF RB,4
0115 0506 00423 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0116 097B 00424 CALL DELAY1
00425
0117 0486 00426 BCF RB,4
0118 0406 00427 BCF RB,0
0119 0000 00428 NOP
00429
011A 0CA5 00430 MOVLW 0A5H
011B 0033 00431 MOVWF U1
00432
011C 0CA5 00433 MOVLW 0A5H
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 11
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
011D 0034 00434 MOVWF D1
00435
Error[120] : Call or jump not allowed at this address (must be in low half of page)
011E 0984 00436 CALL send81
00437
011F 0586 00438 BSF RB,4
0120 0506 00439 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0121 097B 00440 CALL DELAY1
00441
0122 0486 00442 BCF RB,4
0123 0406 00443 BCF RB,0
0124 0000 00444 NOP
00445
0125 0C01 00446 MOVLW 01H
0126 0033 00447 MOVWF U1
00448
0127 0C01 00449 MOVLW 01H
0128 0034 00450 MOVWF D1
00451
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0129 0984 00452 CALL send81
00453
012A 0000 00454 NOP
Error[120] : Call or jump not allowed at this address (must be in low half of page)
012B 097B 00455 CALL DELAY1
00456
012C 0586 00457 BSF RB,4
012D 0506 00458 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
012E 097B 00459 CALL DELAY1
00460
012F 0486 00461 BCF RB,4
0130 0406 00462 BCF RB,0
0131 0000 00463 NOP
00464
0132 0C08 00465 MOVLW 08H
0133 0033 00466 MOVWF U1
00467
0134 0C08 00468 MOVLW 08H
0135 0034 00469 MOVWF D1
00470
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0136 0984 00471 CALL send81 ;
00472
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 12
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0137 0586 00473 BSF RB,4
0138 0506 00474 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0139 097B 00475 CALL DELAY1
00476
013A 0486 00477 BCF RB,4
013B 0406 00478 BCF RB,0
013C 0000 00479 NOP
00480
013D 0CF0 00481 MOVLW 0F0H
013E 0033 00482 MOVWF U1
00483
013F 0CF0 00484 MOVLW 0F0H
0140 0034 00485 MOVWF D1
00486
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0141 0984 00487 CALL send81
00488
0142 0586 00489 BSF RB,4
0143 0506 00490 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0144 097B 00491 CALL DELAY1
00492
0145 0486 00493 BCF RB,4
0146 0406 00494 BCF RB,0
0147 0000 00495 NOP
00496
0148 0CFB 00497 MOVLW 0FBH
0149 0033 00498 MOVWF U1
00499
014A 0CFB 00500 MOVLW 0FBH
014B 0034 00501 MOVWF D1
00502
Error[120] : Call or jump not allowed at this address (must be in low half of page)
014C 0984 00503 CALL send81
00504
014D 0000 00505 NOP
Error[120] : Call or jump not allowed at this address (must be in low half of page)
014E 097B 00506 CALL DELAY1
00507
014F 0586 00508 BSF RB,4
0150 0506 00509 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 13
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0151 097B 00510 CALL DELAY1
00511
0152 0486 00512 BCF RB,4
0153 0406 00513 BCF RB,0
0154 0000 00514 NOP
00515
0155 0C10 00516 MOVLW 10H
0156 0033 00517 MOVWF U1
00518
0157 0C10 00519 MOVLW 10H
0158 0034 00520 MOVWF D1
00521
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0159 0984 00522 CALL send81 ;
00523
015A 0586 00524 BSF RB,4
015B 0506 00525 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
015C 097B 00526 CALL DELAY1
00527
015D 0486 00528 BCF RB,4
015E 0406 00529 BCF RB,0
015F 0000 00530 NOP
00531
0160 0C33 00532 MOVLW 33H
0161 0033 00533 MOVWF U1
00534
0162 0C33 00535 MOVLW 33H
0163 0034 00536 MOVWF D1
00537
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0164 0984 00538 CALL send81
00539
0165 0586 00540 BSF RB,4
0166 0506 00541 BSF RB,0
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0167 097B 00542 CALL DELAY1
00543
0168 0486 00544 BCF RB,4
0169 0406 00545 BCF RB,0
016A 0000 00546 NOP
00547
016B 0C3B 00548 MOVLW 3BH
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 14
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
------
016C 0033 00549 MOVWF U1
00550
016D 0C3B 00551 MOVLW 3BH
016E 0034 00552 MOVWF D1
00553
Error[120] : Call or jump not allowed at this address (must be in low half of page)
016F 0984 00554 CALL send81
00555
0170 0000 00556 NOP
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0171 097B 00557 CALL DELAY1
00558 ;=================================================================
0172 0000 00559 wait NOP
0173 0000 00560 NOP
0174 0000 00561 NOP
Error[120] : Call or jump not allowed at this address (must be in low half of page)
0175 097B 00562 CALL DELAY1
00563
0176 0004 00564 CLRWDT
00565
0177 0C0F 00566 MOVLW 0FH
0178 0002 00567 OPTION
00568
0179 0000 00569 NOP
017A 0B72 00570 GOTO wait
00571
017B 0CFF 00572 DELAY1 MOVLW 0FFH
017C 0030 00573 MOVWF count
00574
017D 0CFF 00575 L101 MOVLW 0FFH
017E 0031 00576 MOVWF count1
00577
017F 02F1 00578 L201 DECFSZ count1,1
0180 0B7F 00579 GOTO L201
00580
0181 02F0 00581 DECFSZ count,1
0182 0B7D 00582 GOTO L101
00583
0183 0800 00584 RETLW 0
00585
0184 00586 send81
0184 0C08 00587 MOVLW 8
0185 0030 00588 MOVWF count
0186 00589 LOOP01
0186 06F3 00590 BTFSC U1,7
0187 0526 00591 BSF RB,1
0188 07F3 00592 BTFSS U1,7
0189 0426 00593 BCF RB,1
00594
018A 06F4 00595 BTFSC D1,7
MPASM 5.20 PIC.ASM 10-9-2009 15:57:57 PAGE 15
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
018B 05A6 00596 BSF RB,5
018C 07F4 00597 BTFSS D1,7
018D 04A6 00598 BCF RB,5
00599
018E 0000 00600 NOP
00601
018F 04C6 00602 BCF RB,6
0190 0446 00603 BCF RB,2
0191 0000 00604 NOP
0192 0000 00605 NOP
0193 0000 00606 NOP
00607
0194 05C6 00608 BSF RB,6
0195 0546 00609 BSF RB,2
0196 0000 00610 NOP
00611
0197 0373 00612 RLF U1,1
0198 0374 00613 RLF D1,1
00614
0199 02F0 00615 DECFSZ count,1
019A 0B86 00616 GOTO LOOP01
00617
019B 0800 00618 RETLW 0
00619
00620
00621 END
从010A开始,函数调用就出错了!是不是程序长度不能超过00FF呢?
其实你用C语音写多好,就不会遇见这样的问题。而且C语言写的话也不用这么多的语句。
PIC单片机在用汇编语言写时,各个BANK之间不能直接调用,在调用之前,你得选择单前的BANK.