本人刚刚学习用silicon laboratories IDE,有个问题想请教
程序如下:
$NOMOD51 ;----------------------------------------------------------------------------- ; Copyright (C) 2005 Silicon Laboratories, Inc. ; All rights reserved. ; ; ; ; FILE NAME : BLINK.ASM ; TARGET MCU : C8051F060/1/2/3 ; DESCRIPTION : This program illustrates how to disable the watchdog timer, ; configure a port and write to a port I/O pin. ; ; NOTES: ; ;-----------------------------------------------------------------------------
$include (c8051f060.inc) ; Include register definition file.
;----------------------------------------------------------------------------- ; EQUATES ;-----------------------------------------------------------------------------
GREEN_LED equ P1.6 ; Port I/O pin connected to Green LED.
;----------------------------------------------------------------------------- ; RESET and INTERRUPT VECTORS ;-----------------------------------------------------------------------------
; Reset Vector cseg AT 0 ljmp Main ; Locate a jump to the start of code at ; the reset vector.
;----------------------------------------------------------------------------- ; CODE SEGMENT ;-----------------------------------------------------------------------------
Blink segment CODE
rseg Blink ; Switch to this code segment. using 0 ; Specify register bank for the following ; program code.
Main: ; Disable the WDT. (IRQs not enabled at this point.) ; If interrupts were enabled, we would need to explicitly disable ; them so that the 2nd move to WDTCN occurs no more than four clock ; cycles after the first move to WDTCN.
mov WDTCN, #0DEh mov WDTCN, #0ADh
; Use SFRs on the Configuration Page mov SFRPAGE, #CONFIG_PAGE
; Enable the Port I/O Crossbar mov XBR2, #40h
; Set P1.6 (LED) as digital output in push-pull mode. orl P1MDOUT,#40h
; Initialize LED to OFF clr GREEN_LED
; Simple delay loop. Loop2: mov R7, #03h Loop1: mov R6, #00h Loop0: mov R5, #00h djnz R5, $ djnz R6, Loop0 djnz R7, Loop1 cpl GREEN_LED ; Toggle LED. jmp Loop2
;----------------------------------------------------------------------------- ; End of file.
END
============================================================ 1、当assemble/compile file 时输出窗口显示:
Invoking project defined assembler. C:Program FilessilabsIDEfilesC51BINA51.exe blink.asm XR GEN DB EP NOMOD51. A51 MACRO ASSEMBLER V7.09 - SN: Eval Version COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2004
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S) -------------------------------------------
当build/make project 时输出窗口显示:
Link in progress... C:Program FilessilabsIDEfilesC51BINBL51.exe @C:iiasmcyglink.txt
BL51 BANKED LINKER/LOCATER V5.03 - SN: Eval Version COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002 C:iiasmlink.obj TO C:iiasmBLINK. RS(256) PL(68) PW(78)
****************************************************************************** * RESTRICTED VERSION WITH 0800H BYTE CODE SIZE LIMIT; USED: 0026H BYTE ( 1%) * ******************************************************************************
>> >> >> Program Size: data=8.0 xdata=0 code=36 LINK/LOCATE RUN COMPLETE. 0 WARNING(S), 0 ERROR(S) ----------------------------------------------------------
当rebuild project 时输出窗口显示:
Invoking project defined compiler. C:Program FilessilabsIDEfilesC51BINA51.exe blink.asm DB OE
A51 MACRO ASSEMBLER V7.09 - SN: Eval Version COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2004
A51 FATAL ERROR - LINE: C:Program FilessilabsIDEfilesC51BINA51.exe blink.asm DB OE# ERROR: UNKNOWN CONTROL A51 TERMINATED.
Invoking project defined assembler. C:Program FilessilabsIDEfilesC51BINA51.exe blink.asm XR GEN DB EP NOMOD51
A51 MACRO ASSEMBLER V7.09 - SN: Eval Version COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2004
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S) Link in progress... C:Program FilessilabsIDEfilesC51BINBL51.exe @C:iiasmcyglink.txt
BL51 BANKED LINKER/LOCATER V5.03 - SN: Eval Version COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002 C:iiasmlink.obj TO C:iiasmBLINK. RS(256) PL(68) PW(78)
****************************************************************************** * RESTRICTED VERSION WITH 0800H BYTE CODE SIZE LIMIT; USED: 0026H BYTE ( 1%) * ******************************************************************************
>> >> >> Program Size: data=8.0 xdata=0 code=36 LINK/LOCATE RUN COMPLETE. 0 WARNING(S), 0 ERROR(S) ----------------------------------------------------------------
请问,中间有些错误(比如“A51 FATAL ERROR”)是什么原因,如何改正?谢谢! |