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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [h8300/] [sim/] [current/] [src/] [delay_us.S] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
;;delay_us
2
 
3
#include 
4
 
5
#include 
6
#include 
7
#include 
8
 
9
#define DELAY_COUNT (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/8*25
10
 
11
//      .file   "delay_us.S"
12
        .h8300h
13
        .text
14
 
15
        .global CYG_LABEL_DEFN(hal_delay_us)
16
CYG_LABEL_DEFN(hal_delay_us):
17
        mov.b   #0,r1l
18
        mov.b   r1l,@CYGARC_8TCNT2:8
19
        mov.b   #1,r1l
20
        mov.b   r1l,@CYGARC_8TCR2:8
21
        mov.b   #0,r2h
22
        sub.w   e1,e1
23
1:
24
        mov.l   er0,er0
25
        ble     6f
26
2:
27
        cmp.w   #DELAY_COUNT,e1
28
        bgt     5f
29
        mov.b   #0,r1h
30
        mov.b   @CYGARC_8TCNT2:8,r2l
31
3:
32
        mov.b   @CYGARC_8TCNT2:8,r1l
33
        cmp.b   r1l,r2l
34
        beq     3b
35
        bcs     4f
36
        inc.b   r1h
37
4:
38
        sub.w   r2,r1
39
        add.w   r1,e1
40
        bra     2b
41
5:
42
        mov.w   e1,r1
43
        mov.b   #DELAY_COUNT,r2l
44
        divxs   r2l,r1
45
        sub.l   er2,er2
46
        mov.b   r1l,r2l
47
        sub.w   r2,e1
48
        dec.l   #1,er0
49
        bra     1b
50
6:
51
        mov.b   #0,r0l
52
        mov.b   r0l,@CYGARC_8TCR2
53
        rts

powered by: WebSVN 2.1.0

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