DEFINITION MODULE c32arith;

FROM K32baseTypes IMPORT
	cardinal16, cardinal32;

EXPORT QUALIFIED
  addc32,                 (* 32-bit unsigned add *)
  subc32,                 (* 32-bit unsigned subtract*)
  cmpc32,                 (* compare two 32-bit cardinals *)
  divc32,                 (* divide a 32-bit by a 16-bit with 32-bit result*)
  mulc32,                 (* multiply a 32-bit by a 16-bit giving a 32-bit result *)
  incc32,                 (* Add a cardinal to a cardinal32 *)
  decc32;

CONST
  c32arithWHAT    = '@(#)c32.mod	1.1{0C}';

VAR
  c32error: BOOLEAN;


PROCEDURE addc32 (
	a :		(*UNIV*) cardinal32;
	VAR b :		(*UNIV*) cardinal32
);


PROCEDURE subc32 (
	a :		(*UNIV*) cardinal32;
	VAR b :		(*UNIV*) cardinal32
);


PROCEDURE cmpc32 (
	a, b :		(*UNIV*) cardinal32
) :			INTEGER;


PROCEDURE divc32 (
	a :		cardinal32;
	b :		(*UNIV*) cardinal16;
	VAR quotient :	cardinal32;
	VAR remainder :	(*UNIV*) cardinal16
);


PROCEDURE mulc32 (
	a :		(*UNIV*) cardinal32;
	b :		(*UNIV*) cardinal16;
	VAR c :		(*UNIV*) cardinal32
);


PROCEDURE incc32 (
	VAR a :		(*UNIV*) cardinal32;
	b :		(*UNIV*) cardinal16
);


PROCEDURE decc32 (
	VAR a :		(*UNIV*) cardinal32;
	b :		(*UNIV*) cardinal16
);


END c32arith.
