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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [verif/] [sw/] [C/] [xram.c] - Blame information for rev 54

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

Line No. Rev Author Line
1 15 dinesha
/*
2
 * Copyright (c) 1999-2001 Tony Givargis.  Permission to copy is granted
3
 * provided that this header remains intact.  This software is provided
4
 * with no warranties.
5
 *
6
 * Version : 2.9
7
 */
8
 
9
/*---------------------------------------------------------------------------*/
10
 
11
#include <8051.h>
12
 
13
unsigned char __xdata buffer[2048];
14
 
15
/*---------------------------------------------------------------------------*/
16
 
17
void main() {
18
 
19
    unsigned short i;
20
    unsigned char cErrCnt = 0;
21
    buffer[0] = 1;
22
    for(i=1; i<2048; i++) {
23
 
24
        buffer[i] = buffer[i - 1] + 1;
25
    }
26
 
27
    for(i=0; i<2048; i++) {
28
        /* Declaration of xram is byte not word */
29
        if(buffer[i] != ((i+1) & 0xFF))  {
30
                cErrCnt++;
31
                P0 = cErrCnt;
32
         }
33
    }
34
 
35
    if(cErrCnt !=0) {
36
        P2 = 0x55; // Test Fail
37
        P3 = cErrCnt;
38
 
39
    } else {
40
       P2 = 0xAA; // Test PASS
41
       P3 = 0xAA; // Test PASS
42
    }
43
 
44
 
45
    while(1);
46
}

powered by: WebSVN 2.1.0

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