GPBCON EQU 0x56000010 GPBDAT EQU 0x56000014 WTCON EQU 0X53000000 LED1 EQU (14<<5) LED2 EQU (13<<5) LED3 EQU (11<<5) LED4 EQU (7<<5)
CODE32 AREA ASM_LED,CODE ,READONLY ENTRY
LDR R0,=WTCON ;看门狗关闭 LDR R1,=0 STR R1,[R0] LDR SP,=1024*4 LDR R0,=GPBCON LDR R1,=(1<<10|1<<12|1<<14|1<<16) STR R1,[R0]
AGAIN LDR R0, =GPBDAT ;LDR R2,[R0] MOV R1,#LED1 STR R1,[R0]
LDR R1,=0X01200000 NEXT1 SUB R1,R1,#1 CMP R1,#0 BNE NEXT1 LDR R0, =GPBDAT ;LDR R2,[R0] MOV R1,#LED2 STR R1,[R0] LDR R1,=0x01200000 NEXT2 SUB R1,R1,#1 CMP R1,#0 BNE NEXT2 LDR R0, =GPBDAT ;LDR R2,[R0] MOV R1,#LED3 STR R1,[R0]
LDR R1,=0X01200000 NEXT3 SUB R1,R1,#1 CMP R1,#0 BNE NEXT3 LDR R0, =GPBDAT ;LDR R2,[R0] MOV R1,#LED4 STR R1,[R0] LDR R1,=0X01200000 NEXT4 SUB R1,R1,#1 CMP R1,#0 BNE NEXT4
B AGAIN END
|