LED灯亮灭控制
.text
.global _start
_start:
@1ldr r0,=0x50000a28ldr r1,[r0]orr r1,r1,#(0x3<<4)str r1,[r0]
@2ldr r0,=0x50006000ldr r1,[r0]bic r1,r1,#(0x3<<20)orr r1,r1,#(0x1<<20)bic r1,r1,#(0x3<<16)orr r1,r1,#(0x1<<16)str r1,[r0]ldr r0,=0x50007000ldr r1,[r0]bic r1,r1,#(0x3<<20)orr r1,r1,#(0x1<<20)str r1,[r0]
@3ldr r0,=0x50006004ldr r1,[r0]bic r1,r1,#(0x1<<10)bic r1,r1,#(0x1<<8)str r1,[r0]ldr r0,=0x50007004ldr r1,[r0]bic r1,r1,#(0x1<<10)str r1,[r0]
@4ldr r0,=0x50006008ldr r1,[r0]bic r1,r1,#(0x3<<20)bic r1,r1,#(0x3<<16)str r1,[r0]ldr r0,=0x50007008ldr r1,[r0]bic r1,r1,#(0x3<<20)str r1,[r0]
@5ldr r0,=0x5000600cldr r1,[r0]bic r1,r1,#(0x3<<20)bic r1,r1,#(0x3<<16)str r1,[r0]ldr r0,=0x5000700cldr r1,[r0]bic r1,r1,#(0x3<<20)str r1,[r0]loop:bl led1_onbl delaybl led1_offbl delaybl led2_onbl delaybl led2_offbl delaybl led3_onbl delaybl led3_offbl delayb loopled1_on:ldr r0,=0x50006014ldr r1,[r0]bic r1,r1,#(0x1<<10)str r1,[r0]mov pc,lrled1_off:ldr r0,=0x50006014ldr r1,[r0]bic r1,r1,#(0x1<<10)str r1,[r0]led2_on:ldr r0,=0x50007014ldr r2,[r0]bic r2,r2,#(0x1<<8)str r2,[r0]mov pc,lr led2_off:ldr r0,=0x50007014ldr r2,[r0]bic r2,r2,#(0x1<<8)str r2,[r0]led3_on:ldr r0,=0x50006014ldr r3,[r0]bic r3,r3,#(0x1<<8)str r3,[r0]mov pc,lr led3_off:ldr r0,=0x50006014ldr r3,[r0]bic r3,r3,#(0x1<<8)str r3,[r0]delay:ldr r4,=0x10000000mm:cmp r4,#0subne r4,r4,#1bne mmmov pc,lr.end