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

Subversion Repositories tv80

[/] [tv80/] [trunk/] [sc_env/] [app_localcfg/] [zsrc/] [sample.c] - Blame information for rev 113

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

Line No. Rev Author Line
1 106 ghutchis
sfr at 0x00 addr0;
2
sfr at 0x01 addr1;
3
sfr at 0x02 data0;
4
sfr at 0x03 data1;
5
sfr at 0x04 data2;
6
sfr at 0x05 data3;
7
 
8
void nmi_isr() {}
9
void isr() {}
10
 
11
void cfgo_write (int addr, long data)
12
{
13
  addr0 = addr & 0xff;
14
  addr1 = addr >> 8;
15
  data0 = addr & 0xff;
16
  data1 = (addr >> 8) & 0xff;
17
  data2 = (addr >> 16) & 0xff;
18
  data3 = (addr >> 24) & 0xff;
19
}
20
 
21
long cfgo_read (int addr)
22
{
23
  long data = 0;
24
  addr0 = addr & 0xff;
25
  addr1 = addr >> 8;
26
  data = data0;
27
  data = data | (data1 << 8);
28
  data = data | (data2 << 16);
29
  data = data | (data3 << 24);
30
 
31
  return data;
32
}
33
 
34
int main ()
35
{
36
  int i;
37
  long d;
38
 
39
  for (i=0; i<20; i=i+1) {
40
    d = i+1;
41
    cfgo_write (i, d);
42
    d = cfgo_read (i);
43
  }
44
 
45
  return 0;
46
}
47
 

powered by: WebSVN 2.1.0

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