;***************************************************************** ;* This stationery serves as the framework for a * ;* user application (single file, absolute assembly application) * ;* For a more comprehensive program that * ;* demonstrates the more advanced functionality of this * ;* processor, please see the demonstration applications * ;* located in the examples subdirectory of the * ;* Freescale CodeWarrior for the HC12 Program directory * ;***************************************************************** ; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as application entry point ; include derivative specific macros INCLUDE 'mc9s12xdp512.inc' ROMStart EQU $4000 ; absolute address to place my code/constant data ; variable/data section ORG RAMStart ; Insert here your data definition. Counter DS.W 1 FiboRes DS.W 1 ; code section ORG ROMStart Entry: LDAA #$ff ;设置端口B为输出 STAA DDRB SEC ;将C=1主要是循环左移做准备 LDAA #$FE SHIFT: STAA PORTB ;跳转到延时 BRA DELAY LOOP: ROLA BRA SHIFT DELAY: LDX #$0200 ;外循环次数 DELAY1: LDY #$0500 ;内循环次数 DELAY2: DEY BNE DELAY2 DEX BNE DELAY1 BRA LOOP ORG $FFFE DC.W Entry ; Reset Vector