OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [sim/] [testsuite/] [d30v-elf/] [tick.s] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
        .globl _start
2
        #
3
        # NOTE: Registers r10-r11 are reserved for the interrupt handler
4
        #       while the others can be used by the main loop/start code.
5
 
6
_start:
7
        # patch the external interrupt handlers entry
8
        add r1, r0, handler
9
        ldw r2, @(r1, 0)
10
        ldw r3, @(r1, 4)
11
        add r1, r0, 0xfffff138
12
        stw r2, @(r1, 0)
13
        stw r3, @(r1, 4)
14
 
15
        # enable external interrupts - cr0 == PSW
16
        mvfsys r2, cr0
17
        or r2, r0, 0x04000000
18
        mvtsys cr0, r2
19
 
20
 
21
        # wait for flag to be set
22
loop:
23
        add r2, r0, flag
24
        ldw r3, @(r2, 0)
25
        bratzr r3, loop
26
 
27
        # clear the flag
28
        stw r0, @(r2, 0)
29
 
30
        add r2, r0, tick
31
        # putstr
32
        .long 0x0e000001, 0x00f00000
33
 
34
        bra loop
35
 
36
        # finished
37
        add r2, r0, r0 || nop
38
        .long 0x0e000004, 0x00f00000
39
 
40
 
41
handler:
42
        jmp real_handler
43
real_handler:
44
        add r10, r0, 1
45
        add r11, r0, flag
46
        stb r10, @(r11,0)
47
        reit
48
 
49
 
50
flag:   .long 0
51
tick:   .ascii "Tick\r\n"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.