#include<iostream.h>
#include<stdlib.h>
#include<String.h>

#define SHORTMAX 65536 // 2^16


int HTOI(char);          /* Take a hex character in [0-9A-Fa-f], return
				corresponding small integer */

char ITOH(short);          /* Take a small integer, return a character
			      representing the hexadecimal value.
			      (always uppercase)  */
char* ITOA(unsigned short);  /* Take a short and return an array of 4 
				characters representing the short */


class Huge {
    unsigned short int v[32];   /* v[31]=most significant short, v[0]=LSD
				   So 64 Bytes to this field */
    unsigned short length;  /* # of shorts in use at any given moment.  
			       So v[length-1] is rightmost non-0 short. */

    /* So to access in asm() statements, we would need 64+2=66 bytes, 
       and if pointer to instance is in %i0, we can make following assumptions:
       &v[0]=%i0, &v[i]=%i0+2*i (as an unsigned short), &length=%i0+64=%i0+0x40
       (as an unsigned short)

       Actually, compiler requires 88 bytes per instance 
       (pointers for functions etc).  
       
       length == [%fp - 24]  == %i0 + 0x40
       v[31] == [%fp - 26]   
       |
       |
       |
       v[0] == [%fp - 88]  == %i0


*/

  public:
    Huge();
    Huge(int);
    Huge(Huge&);
    ~Huge() {;};
    //NOTE:  All input/output is done in HEX!!!
    friend istream& operator>>(istream&, Huge&);
    friend ostream& operator<<(ostream&, Huge&);
    friend Huge operator+(Huge&, Huge&);
    friend Huge operator-(Huge&, Huge&);
    friend Huge operator-(Huge&);
};


