Having these addresses:
; - User data section ------------------------------------- AREA UserData, DATA, READONLY
LEDS EQU 0x4000703C ; access PD3-PD0 GPIO_PORTD_DOR EQU 0xF80FF0C0 GPIO_PORTD_PSOR EQU 0xF80FF0C4 GPIO_PORTD_PCOR EQU 0xF80FF0C8 GPIO_PORTD_PTOR EQU 0xF80FF0CC GPIO_PORTD_PDIR EQU 0xF80FF0D0 GPIO_PORTD_PDDR EQU 0xF80FF0D4 GPIO_PORTD_PCR EQU 0x4004c004 SIM_BASE_SCG5 EQU 0x40048038 SYSCTL_RCGC2_GPIOD EQU 0x1000 ; port D Clock Gating Control PORT_PCR_MUX EQU 0X100
How can I turn on a LED that it is on bit 5 of port D?
I have to do it with assembly code, not C.
Thanks in advantage.
; - User data section AREA UserData, DATA, READONLY K DCD 5 ; - Main Program AREA MainCode, CODE, READONLY, ALIGN=3 __main PROC ; 1) activate clock for Port D LDR r1, =SYSCTL_RCGC2_GPIOD LDR r0, =K LDR r0, [r0] STR r0, [r1] ENDP END