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

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [c64/] [testfiles/] [VirtualTest1.cpp] - Rev 41

Compare with Previous | Blame | View Log

 
extern int printf(char *, ...);
 
class ATest
{
public:
  int avar;
  static int masterKey;
  virtual int MyFunc();
  int MyFunc(int a, int b);
  int (*fncptr)();
  int MyOtherFunc();
  int avarb;
  int Func3(int a,int b,int c);
  int avarc;
};
 
class ATest2 : public ATest
{
	int urvar;
	int anothor_var;
	int MyFunc();
};
 
int ATest::MyFunc()
{
  if (this != 0) {
    prolog {
      asm { hi there };
    }
    printf("master=%d",masterKey);
    printf("Hello World!");
    printf("%d", avarc);
    Func3(avarc);
  }
}
 
int ATest2::MyFunc()
{
  if (this != 0) {
    printf("master=%d",masterKey);
    printf("ATest2 Hello World!");
    printf("%d", avarc);
  }
}
 
int MyFunc(int a, int b)
{
  printf("a=%d",a);
  printf("b=%d",b);
}
 
int ATest::Func3(int b, int c, int d)
{
  printf("%d", b);
  printf("%d", avar);
}
 
 
int main()
{
	ATest testvar;
	ATest *p;
	ATest2 tv2;
 
	printf("%d",testvar.avar);
	testvar.MyFunc();
  testvar.MyFunc(20 , 30);
	testvar.MyOtherFunc();
	testvar.Func3(10 , 15 , 25);
	(*testvar.fncptr)();
	printf("%d",testvar.avarb);
	p->MyFunc();
	printf("%d",tv2.avar);
}
 
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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