Thinking
1. Off watchdog
2. Set Clock
3. Initialize SDRAM
4. relocation
5. Run main
.text segment code representing
.global _start (global reference numeral represents the global)
Off watchdog
can be adjusted c disable_watch_dag complete address is determined watchdog .... 0x
LDR r0 of, = 0x ... LDR violation assembler instruction
MOV R1, # 0
STR R1, [r0 of]
to set the clock can be used Clock_Init c ()
CLKDIVN define the location of the board
LDR r0 of, = 0x4c00001
MOV R1, # 0x03 0x03 division factor of FCLK //: HCLK: = the PCLK. 1: 2:. 4, HDIVN =. 1, PDIVN. 1 =
STR R1, [r0 of] ASM if c it is a sign of the read chip embedded in the assembly manual adjustment asynchronous mode, according to the specific circumstances of the chip
mrc instruction register ARM processor to transfer data to a register in the coprocessor. If the coprocessor does not successfully perform this operation, the undefined instruction exception interrupt
MCR {
Rd> is not a PC, if it is a PC, you instruction operation to the unpredictable results obtained coprocessor register
orr ORR instruction format: ORR {Conditions} {S} destination register operand 1, operand 2
the ORR instructions for performing the logic ring on two operands operation, placing the result in the destination register
operand register should be a 1, operand 2 may be a register, a shift register or an immediate constant.
The instruction set used in certain bits of the operand 1.
MRC instructions in the coprocessor register value is transferred to the ARM processor registers. If the coprocessor does not successfully perform this operation, the undefined instruction exception interrupt
Instruction Example: ORR R0, R0, # 3 ;
the instruction sets bit 0 of R0, the remaining bits remain unchanged.
ORR r0, r0, # 0xD3
0xD3 = 1101 0111
r0 is the 0xD3 for arithmetic or operation, and the result is returned to r0, i.e. the 'bit r0 [7: 6] and bit [4] and bit [2: 0] is set 1