初次寫組合, 不知哪邊出問題
原始程式如下:
list p=10F202 ; list directive to define processor
#include <p10F202.inc> ; processor specific variable definitions
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
__CONFIG _MCLRE_OFF & _CP_ON & _WDT_OFF
; 定義變數在RAM的位址
CBLOCK 0x08
int_counter
counter
ENDC
TMR0_TIMEOUT EQU 0x7D ; 125 = 0x7D 加上延遲
INTERNAL_TMR0 EQU 25
GP0 EQU 0x00
GP1 EQU 0x01
GP2 EQU 0x02
GP3 EQU 0x03
;RESET vector used to load calibration for internal clock
;;;RESET_VECTOR CODE 0x1FF
; Internal RC calibration value is placed at location 0x1FF by Microchip
; as a movlw k, where the k is a literal value.
ORG 0x000
movwf OSCCAL ; update register with factory cal value
bsf OSCCAL,0
;***********************************************
;* Initial Timer0 subroutine
;***********************************************
Initial_Timer0
clrf TMR0
movlw b'10000101'
OPTION ; Prescaler 1:64
retlw 0
;---------------------------------------------------------------------------
start ; the code start here
;initialisation GPIO / inter osc
movlw b'00001000'
tris GPIO
movlw INTERNAL_TMR0
movwf int_counter
movlw .16
movwf counter
call Initial_Timer0
bsf GPIO, GP0 ; High
loop1
;if (TMR0 >= TMR0_TIMEOUT)
movlw TMR0_TIMEOUT
subwf TMR0, W
btfss STATUS, C
goto judge2
;MOVLW 0x13
;MOVWF 0xa
call Initial_Timer0
incf int_counter, F
judge2
;if (int_count >= INTERNAL_TMR0)
movlw INTERNAL_TMR0
subwf int_counter, W
btfss STATUS, C
goto loop1
movlw 0x01 ; GP0
xorwf GPIO, F
clrf int_counter
incf counter, F
decfsz counter, F
goto loop1
loop2
goto loop2
END ; end of program
//---------------------------------------------------------------------------
使用MPLAB IDE7.1 + MPASM + ICD2
compiler後出現錯誤訊息, 不知哪邊出問題, 請各位前輩高抬貴手, 指點一下.
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE" /q /p10F202 "main.asm" /l"main.lst" /e"main.err"
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 3 : Found directive in column 1. (list)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 8 : Found directive in column 1. (__CONFIG)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 19 : Found directive in column 1. (CBLOCK)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 22 : Found directive in column 1. (ENDC)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 46 : Found directive in column 1. (ORG)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 76 : Illegal character (
)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 77 : Illegal character (
)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 78 : Illegal character (
)
Halting build on first failure as requested.
BUILD FAILED: Thu Dec 22 18:25:04 2005
謝謝!