#ifndef _REGISTERS_H
#define _REGISTERS_H

#include "ktypes.h"

/* ----------------------------------------------------- */

// The REGISTERS unit defines the organization and
// data representation for the 32 registers found
// within the KBOX machine.

// Since all calculations and comparisons are performed
// with the KBOX register sets, the two register sets
// IREGS and FREGS are comprised of 64 bit klunks.

// IREGS are used for all
// unsigned and signed integer operations

//     unsigned integer values: calculation and comparison
//     signed integer values: calculation and comparison
//     single ASCII values: comparison and manipulation

// FREGS are used for all floating point operations

//     floating point values: calculation and comparison

// Support procedures are provided display registers:

//     displayIregs
//     displayFregs

/* ----------------------------------------------------- */

  #define NO_REGS	16

  typedef klunk		regsType[NO_REGS];
  typedef klunk*	klunkPtr;

  regsType              IREGS;
  regsType              FREGS;

// Access to registers is via register names!

//    I0 through I15 for integer registers (IREGS)
//    F0 through F15 for floating point registers (FREGS)

//    I7 references IREGS[7];
//    F12 references FREGS[12]; etc.

// In addition, many registers have special purpose roles
//    IA, IB, ... , HP and FA, FA, FC, and FD

/* ----------------------------------------------------- */

int		isIreg		(char*);
int		isFreg		(char*);

klunkPtr	addrReg		(char*);

void		displayIregs	(char);
void		displayFregs	(void);

/* ----------------------------------------------------- */

char*		checkAlias	(char*);

/* ----------------------------------------------------- */

#endif
