Em la lính mới, lâu nay chỉ quen viết code bằng C và Basic, hôm nay mới xêm căn bản của MPAsm. Từ thread Hoc pic trong 1 ngay, em copy doan code sau
[QUOTE] TITLE "Mach test LED_1"
PROCESSOR P16F628A
INCLUDE <P16F628A.inc>
__CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF &_HS_OSC
ORG 0x0000
GOTO MAIN
ORG 0x0005
MAIN
BANKSEL TRISB ; bank select
CLRF TRISB ; trisb = 00000000
; portb = output
BANKSEL PORTB
BSF PORTB, 0 ; rb0 = 1
; RB0 = 5V
GOTO $ ; dung chuong trinh tai day
; vong lap tai cho^~
; khong bao gio ket thuc
END ; lenh bat buoc de ket thuc
[\QUOTE]
nhung den khi dich thi MPasm lai báo:
Error[132] temp.ASM 2 : Unknown processor (P16F628A)
Message[301] P16F628A.INC 35 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Error[131] temp.ASM 4 : Processor type is undefined
Warning[207] ASD.ASM 7 : Found label after column 1. (GOTO)
Error[122] temp.ASM 7 : Illegal opcode (MAIN)
Message[312] temp.ASM 13 : Page or Bank selection not needed for this device. No code generated.
Warning[207] temp.ASM 14 : Found label after column 1. (CLRF)
Error[122] temp.ASM 14 : Illegal opcode (TRISB)
Message[312] temp.ASM 16 : Page or Bank selection not needed for this device. No code generated.
Warning[207] temp.ASM 17 : Found label after column 1. (BSF)
Error[122] temp.ASM 17 : Illegal opcode (PORTB)
Warning[207] temp.ASM 19 : Found label after column 1. (GOTO)
Error[108] temp.ASM 19 : Illegal character ($)
Error[131] temp.ASM 23 : Processor type is undefined
Mong các tiền bối giúp đỡ
Cám ơn
|