12.21作业


.text 
.global _start
_start: 
        @设置rcc
            ldr r0,=0x50000a28
            ldr r1,[r0]
            orr r1,r1,#(1<<4)
            str r1,[r0]
        @设置GPIOE_MODER
            ldr r0,=0x50006000
            ldr r1,[r0]
            bic r1,r1,#(1<<21)
            orr r1,r1,#(1<<20)
            bic r1,r1,#(1<<17)
            orr r1,r1,#(1<<16)
            str r1,[r0]
        @设置GPIOE_OTYPER
            ldr r0,=0x50006004
            ldr r1,[r0]
            bic r1,r1,#(1<<10)
            bic r1,r1,#(1<<8)
            str r1,[r0]       
        @设置GPIOE_OSPEEDER
             ldr r0,=0x50006008
            ldr r1,[r0]
            bic r1,r1,#(0x3<<20)
            bic r1,r1,#(0x3<<16)
            str r1,[r0]    
        @设置GPIOE_PUPDR
              ldr r0,=0x5000600c
            ldr r1,[r0]
            bic r1,r1,#(0x3<<20)
            bic r1,r1,#(0x3<<16)
            str r1,[r0] 

        @设置rcc
            ldr r0,=0x50000a28
            ldr r1,[r0]
            orr r1,r1,#(1<<5)
            str r1,[r0]
             @设置GPIOF_MODER
            ldr r0,=0x50007000
            ldr r1,[r0]
            bic r1,r1,#(1<<21)
            orr r1,r1,#(1<<20)
            str r1,[r0]
        @设置GPIOF_OTYPER
            ldr r0,=0x50007004
            ldr r1,[r0]
            bic r1,r1,#(1<<10)
            str r1,[r0]       
        @设置GPIOF_OSPEEDER
             ldr r0,=0x50007008
            ldr r1,[r0]
            bic r1,r1,#(0x3<<20)
            str r1,[r0]    
        @设置GPIOF_PUPDR
              ldr r0,=0x5000700c
            ldr r1,[r0]
            bic r1,r1,#(0x3<<20)
            str r1,[r0] 

flash:
        bl led1_on
        bl delelay
        bl led1_off
        bl delelay
        bl led2_on
        bl delelay
        bl led2_off
        bl delelay
        bl led3_on
        bl delelay
        bl led3_off
        bl delelay
        b flash

led1_on:
        @设置GPIOE_ODR 
          ldr r0,=0x50006014
          ldr r1,[r0]
          orr r1,r1,#(1<<10)
          str r1,[r0]  
          mov pc,lr
led1_off:
@设置GPIOE_ODR 
          ldr r0,=0x50006014
          ldr r1,[r0]
          bic r1,r1,#(1<<10)
          str r1,[r0]  
          mov pc,lr

 led2_on:
        @设置GPIOF_ODR 
          ldr r0,=0x50007014
          ldr r1,[r0]
          orr r1,r1,#(1<<10)
          str r1,[r0]  
          mov pc,lr
led2_off:
@设置GPIOF_ODR 
          ldr r0,=0x50007014
          ldr r1,[r0]
          bic r1,r1,#(1<<10)
          str r1,[r0]  
          mov pc,lr

led3_on:
        @设置GPIOE_ODR 
          ldr r0,=0x50006014
          ldr r1,[r0]
          orr r1,r1,#(1<<8)
          str r1,[r0]  
          mov pc,lr
led3_off:
@设置GPIOE_ODR 
          ldr r0,=0x50006014
          ldr r1,[r0]
          bic r1,r1,#(1<<8)
          str r1,[r0]  
          mov pc,lr

delelay:
      ldr r3,=0x10000000
wait:
      cmp r3,#0
      subne r3,r3,#1
      bne wait
      mov pc,lr

.end


你可能感兴趣的:(javascript,开发语言,ecmascript)