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

Subversion Repositories rise

[/] [rise/] [trunk/] [examples/] [uart_sample.s] - Blame information for rev 129

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

Line No. Rev Author Line
1 129 jlechner
/*
2
 * Description: UART sample
3
 */
4
 
5
  .text
6
  .org    0x0000
7
 
8
  /* address for status register */
9
  ld    r8, #0x0
10
  ldhb  r8, #0x80
11
  /* address for uart data register */
12
  ld    r9, #0x01
13
  ldhb  r9, #0x80
14
  /* addresses for branch targets */
15
  ld      r11, addrlo(check_rdrf)
16
  ldhb    r11, addrhi(check_rdrf)
17
  ld      r12, addrlo(check_tdre)
18
  ldhb    r12, addrhi(check_tdre)
19
 
20
 jmp r12
21
 
22
  /* wait for uart receiver data */
23
check_rdrf:
24
  ld r2, [r8]
25
  ld R3, #0x2
26
  and r2, r3
27
  jmpz r11
28
 
29
  /* data available, read data */
30
  ld r4, [R9]
31
 
32
  /* increment received data by one */
33
  add r4, #0x1
34
 
35
  /* wait for transmitter register empty */
36
check_tdre:
37
  ld r2, [r8]
38
  ld r3, #0x1
39
  and r2, r3
40
  jmpz r12
41
 
42
  /* transmitter register empty: send data */
43
  st r4, [r9]
44
 
45
/* back to start */
46
jmp r11

powered by: WebSVN 2.1.0

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