摘取其中的一部分程序如下:
XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as application entry point
; include derivative specific macros INCLUDE 'qy4_registers.inc'
ORG RAMStart ; Insert here your data definition ;---------------Flag Register Block FLAG1: DS.B 1
ORG ROMStart Entry: LDHX #RAMEnd+1 ; initialize the stack pointer TXS ; RSP ;----------------------------------- BCLR 0,FLAG1 ;----------------------------------- ; JSR InstructionStudy JMP $
為什麼以上程序在軟件調試時,在執行到 BCLR 0,FLAG1 這一行指令時,出現如下錯誤提示:
Error: At location 0080 - Error: Attempt to use invalid or uninitialized memory STEPPED
我所選用的MCU型號是:M68HC908QY4,$0080明明是RAM的超始地址,怎麼會:"invalid"
如果將程序改為如下,則不再提示錯誤: ORG ROMStart Entry: LDHX #RAMEnd+1 ; initialize the stack pointer TXS ; RSP ;----------------------------------- CLR FLAG1 BSET 0,FLAG1 ;----------------------------------- JMP $
請問為什麼? |