Vì quá kém cỏi đành xin trưởng lão thọ giáo thêm chút nữa !
vì sao chương trình này em viết dịch bị lỗi !
Code:
;====================================
; bai tap 2
; mach den chop 8 led tu trai qua phai
;ngay bat dau :12/08/2006
;nguoi thuc hien : vu dinh lieu
;mo ta phan cung : Dung PIC16F628A - thach anh 4MHz
; : LED giao tiep voi PORTB
; : Cuc am cua LED noi voi GND
; : RB0 - RB7 la cac chan output
; Chu thich :
; dùng thanh ghi W ghi vào giá tri 00000001
; xuat ra PORTB
; delay
; dùng lenh dich trai portB
; xuat ra PORTB 15
;====================================================================
TITLE "Mach chop 8 LED_1"
PROCESSOR P16F628A
INCLUDE <P16F628A.inc>
__CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF &_HS_OSC
;=======================================================
count1 EQU 0x20 ; cac bien dung cho doan chuong trinh delay
counta EQU 0x21
countb EQU 0x22
;===============================================================================
ORG 0x0000
GOTO MAIN
ORG 0x0005
MAIN
BANKSEL TRISB ; bank select
CLRF TRISB ; trisb = 00000000
; portb = output
LOOP
BANKSEL PORTB
MOVLW 0x01
MOVWF PORTB ; rb = 00000001
CALL delay_100ms
RLF PORTB,f
GOTO LOOP
GOTO $ ; dung chuong trinh tai day
; vong lap tai cho^~
; khong bao gio ket thuc
delay_100ms ; label bat dau chuong trinh con
MOVLW d'100' ; doan code cho chuong trinh con delay 100 ms
MOVWF count1
d1
MOVLW d'199'
MOVWF counta
MOVLW d'1'
MOVWF countb
delay_0
DECFSZ counta,f
GOTO $+2
DECFSZ countb,f
GOTO delay_0
DECFSZ count1,f
GOTO d1
RETURN
END
và các lỗi nhận cược nhu sau
Make: The target "E:\pic1\baitap2.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F628A "baitap2.asm" /l"baitap2.lst" /e"baitap2.err" /o"baitap2.o"
Warning[215] E:\PIC1\BAITAP2.ASM 18 : Processor superseded by command line. Verify processor symbol.
Message[302] E:\PIC1\BAITAP2.ASM 32 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[113] E:\PIC1\BAITAP2.ASM 54 : Symbol not previously defined ( )
Error[112] E:\PIC1\BAITAP2.ASM 54 : Missing operator
Error[113] E:\PIC1\BAITAP2.ASM 57 : Symbol not previously defined (f )
Error[113] E:\PIC1\BAITAP2.ASM 58 : Symbol not previously defined (d1 )
Halting build on first failure as requested.
BUILD FAILED: Sat Aug 12 18:02:25 2006