Home arrow Support arrow Forums

Luminary Micro Forums

hilarycheng

Fresh Boarder

2006/11/12 23:44

EV-LM3S811 blinking LED in assembler (for GCC)

thanks you for dalewheat for sharing the Blinking for Keil. I just modified it for GCC version. Here it is.

Code:

      .section .start     .cpu cortex-m3     .fpu softvfp     .thumb _isr:    .word    0x20000108  Position 00 Stack Pointer     .word    _start      Position 01 Reset Pointer     .word    int_handler Position 02 NMI     .word    int_handler Position 03 Hard Fault     .word    int_handler Position 04 Memory Fault     .word    int_handler Position 05 Bus Fault     .word    int_handler Position 06 Usage Fault     .word    0x00000000  Position 07 Reserved     .word    0x00000000  Position 08 Reserved     .word    0x00000000  Position 09 Reserved     .word    0x00000000  Position 10 Reserved     .word    int_handler Position 11 SVCall     .word    int_handler Position 12 Debug Monitor     .word    int_handler Position 13 Reserved     .word    int_handler Position 14 PendSV     .word    int_handler Position 15 SysTick     .word    int_handler Position 16 GPIO A     .word    int_handler Position 17 GPIO B     .word    int_handler Position 18 GPIO C     .word    int_handler Position 19 GPIO D     .word    int_handler Position 20 GPIO E     .word    int_handler Position 21 UART 0     .word    int_handler Position 22 UART 1     .word    int_handler Position 23 SSI     .word    int_handler Position 24 I2C     .word    int_handler Position 25 PWM Fault     .word    int_handler Position 26 PWM Generator 0     .word    int_handler Position 27 PWM Generator 1     .word    int_handler Position 28 PWM Generator 2     .word    0x00000000  Position 29 Reserved     .word    int_handler Position 30 ADC Sequence 0     .word    int_handler Position 31 ADC Sequence 1     .word    int_handler Position 32 ADC Sequence 2     .word    int_handler Position 33 ADC Sequence 3     .word    int_handler Position 34 Watchdog Timer     .word    int_handler Position 35 Timer 0A     .word    int_handler Position 36 Timer 0B     .word    int_handler Position 37 Timer 1A     .word    int_handler Position 38 Timer 1B     .word    int_handler Position 39 Timer 2A     .word    int_handler Position 40 Timer 2B     .word    0x00000000  Position 41 Reserved     .word    int_handler Position 42 Analog Comparator 0     .word    0x00000000  Position 43 Reserved     .word    0x00000000  Position 44 Reserved     .word    int_handler Position 45 System Control     .word    int_handler Position 46 Flash Control      .word    0x00000000  Position 47 Reserved     .word    0x00000000  Position 48 Reserved     .equ    RCGC2,    0x400FE108     .equ    PORT_RCC0x400FE060     .equ    PORT_C,   0x40006000     .equ    RCC,      0x04803AC0     .equ    PORTC_ENABLE0x04     .equ    PC5_OUTPUT,   0x20     .align    2     .thumb     .thumb_func     .text _start:     ldr    r0, =PORT_RCC     ldr    r1, =RCC     str    r1, [r0]     ldr    r0, =RCGC2     ldr    r1, =PORTC_ENABLE     str    r1, [r0]          ldr    r0, =(PORT_C 0x400)     ldr    r1, =PC5_OUTPUT     str    r1, [r0] loop:         ldr    r0, =(PORT_C PC5_OUTPUT << 2)     ldr    r1, =PC5_OUTPUT     str    r1, [r0]     ldr    r2, =0x00060000 delay1:         sub    r2r2#1     bne    delay1     ldr    r0, =(PORT_C PC5_OUTPUT << 2)     eor    r1r1     str    r1, [r0]     ldr    r2, =0x00060000 delay2:         sub    r2r2#1     bne    delay2          b    loop     .align    2     .thumb     .thumb_func     .text      int_handler:     b    int_handler

login or register to reply

      Topics Author Date
    emo
EV-LM3S811 blinking LED in assembler (for GCC)
hilarycheng 2006/11/12 23:44