Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b reset
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- b hang
- TIMER_CR EQU 8 ; Control Register, TimerXControl
- TIMER_INTCLR EQU 0xC ; Interrupt Clear Register, TimerXIntClr
- reset:
- mov sp, #0x20000
- ;****************************************
- ;* Enable Timer0 and IRQs *
- ;****************************************
- ldr r1, [TIMER_BASE]
- add r1, TIMER_CR
- mov r0, #0
- str r0, [r1]
- ldr r0, [TIMER_COUNT]
- ldr r1, [TIMER_BASE]
- str r0, [r1]
- ldr r1, [TIMER_BASE]
- add r1, TIMER_INTCLR
- mov r2, #0
- str r2, [r1]
- mov r0, #0xE2 ; Timer Enable, Periodic Mode, IRQ ON, Prescale = 0, 32 bit, Wrapping Mode
- ldr r1, [TIMER_BASE]
- add r1, TIMER_CR
- str r0, [r1]
- mrs r0, cpsr
- bic r0, r0, #0x80 ; Clear IRQ Disable
- msr cpsr_c, r0
- b mainloop
- TIMER_BASE: dd 0x101E2000
- TIMER_COUNT: dd 1000000
- hang:
- b hang
- ;****************************************
- ;* Kernel Mainloop *
- ;****************************************
- mainloop:
- ldr r1, [pc, 4]
- bl uart_put32
- b mainloop
- dd 0x50505050
- ;****************************************
- ;* UART Write 32 Bit Value *
- ;* Input: R1 Value to be written *
- ;* Output: None *
- ;****************************************
- uart_put32:
- ldr r0, [pc, 4] ; PC + 16
- str r1, [r0]
- bx lr
- dd 0x101f1000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement