Re: assembly functions ans c++ classes



On 28 Jun 2005 03:12:31 -0700, asetofsymbols@xxxxxxxxx wrote:
we are in c++. I have some assembly function
u* f0(u*,...,u*);
.....
u* fn(u*,...,u*);
where I will say num is a struct

typedef struct{unsigned len; unsigned* n}num;

I have thought and decided

for unsigned number:

class unum{
public:
fucntions and operators that use f0, f1... fn
example
friend unum& operator-(const unum& a, const unum& b);
...
protected:
num* f0(num*,...,num*);
...
num* fn(num*,...,num*);
private:
num n; // number
unsigned lm; // memory
}

the class for signed big numbers

class snum{
public:
fucntions and operators that use f0, f1... fn
example
friend snum& operator-(const snum& a, const snum& b);
...
private:
unum sn; // number
int sign;
}

the class for big float

class fnum{
public:
fucntions and operators that use f0, f1... fn
example
friend fnum& operator-(const fnum& a, const fnum& b);
...
private:
snum fn;
unsigned fdigit;
}

What do you say?

>
>All the classes uint, sint, fint use the assembly functions f0, f1, ...
>fn and I would like that these functions are accessible only from
>uint, sint, fint classes.
>How can I define these last 2 classes for to work better in c++?
>Thank you

.



Relevant Pages