Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Spec SYSTEM

SYSTEM

Spec.SYSTEM History

Hide minor edits - Show changes to output

2010-05-24 11:44 by benjk -
Changed lines 3-5 from:
  (* Pseudo module for access to system dependent resources *)

to:
(* Pseudo-module for Access to System Dependent Resources *)

Changed lines 17-18 from:
   BYTE;  (* virtual byte with a bit width divisible by eight *)
to:
   BYTE = ARRAY OctetsPerByte OF OCTET;  (* virtual byte *)
Changed lines 68-69 from:
(* general system level facilities *)
to:
(* General system level facilities *)
Changed lines 71-72 from:
  (* returns the address of variable var *)
to:
(* Returns the address of variable var. *)
Changed lines 74-79 from:
  (* returns the value of val, cast to the target type,
    val may be a variable, a constant or a literal *)


(* machine level operations *)
to:
(* Returns the value of val, cast to the target type,
  val may be a variable, a constant or a literal. *)


(* Machine level operations *)
Changed lines 85-86 from:
(* machine level arithmetic *)
to:
(* Machine level arithmetic *)
Changed lines 88-89 from:
  (* increments the value of operand x by n, ignoring overflow *)
to:
(* Increments the value of operand x by n, ignoring overflow. *)
Changed lines 91-150 from:
  (* decrements the value of operand x by n, ignoring overflow *)

PROCEDURE ADDC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* adds operand y to operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)

PROCEDURE SUBC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* subtracts operand y from operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)


(* shift operations *)

PROCEDURE SHL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x shifted left by n bits *)

PROCEDURE SHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x logically shifted right by n bits *)

PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x arithmetically shifted right by n bits *)

PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits *)

PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits *)

PROCEDURE ROTLC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)

PROCEDURE ROTRC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)


(* bitwise operations *)

PROCEDURE BWNOT( x : <AnyType> ) : TypeOf(x);
  (* returns the bitwise logical NOT of operand x *)

PROCEDURE BWAND( x, y : <AnyType> ) : TypeOf(x);
  (* returns the bitwise logical AND of operands x and y *)

PROCEDURE BWOR( x, y : <AnyType> ) : TypeOf(x);
  (* returns the bitwise logical OR of operands x and y *)

PROCEDURE BWXOR( x, y : <AnyType> ) : TypeOf(x);
  (* returns the bitwise logical exclusive OR of operands x and y *)

PROCEDURE BWNAND( x, y : <AnyType> ) : TypeOf(x);
  (* returns the inverted bitwise logical AND of operands x and y *)

PROCEDURE BWNOR( x, y : <AnyType> ) : TypeOf(x);
  (* returns the inverted bitwise logical OR of operands x and y *)


(* single bit operations *)
to:
(* Decrements the value of operand x by n, ignoring overflow. *)

PROCEDURE ADDC( VAR x : <AnyType>; y : <TypeOf(x)>; VAR c : BOOLEAN );
(* adds operand y to operand x, adds 1 if TRUE is passed in for c,
  then passes the result back in x and the carry bit back in c. *)

PROCEDURE SUBC( VAR x : <AnyType>; y : <TypeOf(x)>; VAR c : BOOLEAN );
(* subtracts operand y from operand x, adds 1 if TRUE is passed in for c,
  then passes the result back in x and the carry bit back in c. *)


(* Shift operations *)

PROCEDURE SHL( x : <AnyType>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x shifted left by n bits. *)

PROCEDURE SHR( x : <AnyType>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x logically shifted right by n bits. *)

PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x arithmetically shifted right by n bits. *)

PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x rotated left by n bits. *)

PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x rotated right by n bits. *)

PROCEDURE ROTLC( x : <AnyType>; VAR c : <TypeOf(x)>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x rotated left by n bits,
  rotating through n bits of c, passing the rotated out bits back in c. *)

PROCEDURE ROTRC( x : <AnyType>; VAR c : <TypeOf(x)>; n : OCTET ) : <TypeOf(x)>;
(* Returns the value of operand x rotated right by n bits,
  rotating through n bits of c, passing the rotated out bits back in c. *)


(* Bitwise operations *)

PROCEDURE BWNOT( x : <AnyType> ) : <TypeOf(x)>;
(* Returns the bitwise logical NOT of operand x. *)

PROCEDURE BWAND( x, y : <AnyType> ) : <TypeOf(x)>;
(* Returns the bitwise logical AND of operands x and y. *)

PROCEDURE BWOR( x, y : <AnyType> ) : <TypeOf(x)>;
(* Returns the bitwise logical OR of operands x and y. *)

PROCEDURE BWXOR( x, y : <AnyType> ) : <TypeOf(x)>;
(* Returns the bitwise logical exclusive OR of operands x and y. *)

PROCEDURE BWNAND( x, y : <AnyType> ) : <TypeOf(x)>;
(* Returns the inverted bitwise logical AND of operands x and y. *)

PROCEDURE BWNOR( x, y : <AnyType> ) : <TypeOf(x)>;
(* Returns the inverted bitwise logical OR of operands x and y. *)


(* Single bit operations *)
Changed lines 152-153 from:
  (* sets bit n of x if bitval is TRUE, otherwise clears it *)
to:
(* Sets bit n of x if bitval is TRUE, otherwise clears it. *)
Changed lines 155-171 from:
  (* returns TRUE if bit n of x is set, otherwise FALSE *)


(* bit tests *)

PROCEDURE LSBIT( x : <AnyType> ) : TypeOf(x);
  (* returns
the position of the least significant set bit of x *)

PROCEDURE MSBIT( x : <AnyType> ) : TypeOf(x);
  (* returns
the position of the most significant set bit of x *)

PROCEDURE CSBITS( x : <AnyType> ) : TypeOf(x);
  (* counts and returns the number of set bits in
x *)


(* miscellaneous *)
to:
(* Returns TRUE if bit n of x is set, otherwise FALSE. *)


(* Bit tests *)

PROCEDURE LSBIT( x : <AnyType> ) : CARDINAL;
(* Returns the position of the least significant set bit of x. *)

PROCEDURE MSBIT( x : <AnyType> ) : CARDINAL;
(* Returns the position of the most significant set bit of x. *)

PROCEDURE CSBITS( x : <AnyType> ) : CARDINAL;
(* Counts and returns the number of set bits in x. *)


(* Miscellaneous *)
Changed lines 173-175 from:
  (* returns program control to the caller of the calling procedure and
    passes x as the return value, x must match the caller's return type *)
to:
(* Returns program control to the caller of the calling procedure and
  passes x as the return value, x must match the caller's return type. *)
Changed lines 177-178 from:
  (* immediately aborts the running program and passes a status code to the
    operating environment, status codes are target platform dependent *)
to:
(* Immediately aborts the running program and passes a status code to the
  operating environment, status codes are target platform dependent. *)
2010-04-18 08:22 by benjk -
Added lines 171-174:

PROCEDURE RETCC( x : <AnyType> );
  (* returns program control to the caller of the calling procedure and
    passes x as the return value, x must match the caller's return type *)
2010-03-13 17:42 by benjk -
Changed line 174 from:
     operating environment, status codes are operating environment dependent *)
to:
     operating environment, status codes are target platform dependent *)
2010-03-13 17:39 by benjk -
Changed line 174 from:
     operating environment, status codes depend on the operating environment *)
to:
     operating environment, status codes are operating environment dependent *)
2010-03-13 17:38 by benjk -
Changed line 174 from:
     execution environment, status codes depend on the execution environment *)
to:
     operating environment, status codes depend on the operating environment *)
2010-03-13 17:37 by benjk -
Changed line 174 from:
     execution environment, status codes dependent on the execution environment *)
to:
     execution environment, status codes depend on the execution environment *)
2010-03-13 17:36 by benjk -
Changed line 174 from:
     execution environment, status codes are dependent on the environment *)
to:
     execution environment, status codes dependent on the execution environment *)
2010-03-13 16:57 by benjk -
Changed lines 173-174 from:
  (* aborts the running program and passes status code to host environment,
    status code is target dependent, should only be used for debugging *)
to:
  (* immediately aborts the running program and passes a status code to the
 
    execution environment, status codes are dependent on the environment *)
2010-03-13 16:52 by benjk -
Changed line 174 from:
     status code is target dependent, should only be used for debugging *)
to:
     status code is target dependent, should only be used for debugging *)
2010-03-13 16:52 by benjk -
Changed line 174 from:
      the status code is target dependent, should only be used for debugging *)
to:
     status code is target dependent, should only be used for debugging *)
2010-03-13 16:52 by benjk -
Added lines 169-174:

(* miscellaneous *)

PROCEDURE HALT( status : <OrdinalType> );
  (* aborts the running program and passes status code to host environment,
      the status code is target dependent, should only be used for debugging *)
2010-03-11 16:24 by benjk -
Changed lines 81-82 from:
   MaxWordsPerOperand = <implementation defined value>;
    (* size of largest supported operand in machine level operations, >= 4 *)
to:
   MaxWordsPerOperand = <implementation defined value>; (* >= 4 *)
     (* size of largest supported operand in machine level operations *)
2010-03-11 16:23 by benjk -
Changed lines 81-82 from:
   WordsPerOperand = <implementation defined value greater or equal 4>;
     (* size of largest supported operand in machine level operations *)
to:
   MaxWordsPerOperand = <implementation defined value>;
   
  (* size of largest supported operand in machine level operations, >= 4 *)
2010-03-11 14:54 by benjk -
Changed lines 74-75 from:
  (* returns the value of val, cast to the target type *)
to:
  (* returns the value of val, cast to the target type,
    val may be a variable, a constant or a literal
*)
2010-03-11 08:27 by benjk -
Changed line 64 from:
   TargetIsBiEndian = <target dependent value>;
to:
   TargetIsBiEndian = <target dependent boolean value>;
Changed line 150 from:
PROCEDURE SETBIT( VAR x : <AnyType>; n : OCTET; bit : BOOLEAN );
to:
PROCEDURE SETBIT( VAR x : <AnyType>; n : OCTET; bitval : BOOLEAN );
2010-03-11 08:22 by benjk -
Added lines 55-60:
   BigLittleEndian = 02301H;
      (* constant for 2-3-0-1 byte order *)

    LittleBigEndian = 02103H;
      (* constant for 2-1-0-3 byte order *)

Changed line 65 from:
     (* TRUE if the target's endianness is configurable, otherwise FALSE *)
to:
     (* TRUE if the target is bi-endian, otherwise FALSE *)
2010-03-11 07:46 by benjk -
Added lines 57-59:

    TargetIsBiEndian = <target dependent value>;
      (* TRUE if the target's endianness is configurable, otherwise FALSE *)
2010-03-11 07:28 by benjk -
Changed lines 49-60 from:
   TargetEndianess = <target dependent value>;
      (* endianness of the target architecture,
        any of NonEndian, BigEndian, LittleEndian or MixedEndian *)

    NonEndian = <implementation defined constant>;
    BigEndian = <implementation defined constant>;
    LittleEndian = <implementation defined constant>;
    MixedEndian = <implementation defined constant>;

PROCEDURE TargetOctetOrder( n : OCTET ) : OCTET;
  (* returns the significance of the n-th octet in a four octet value
    as it is used by the storage model
of the target architecture *)
to:
   BigEndian = 03210H;
 
    (* constant for 3-2-1-0 byte order *)

    LittleEndian = 0123H;
     (* constant for 0-1-2-3 byte order *)

    TargetByteOrder = <target dependent value>;
      (* byte order of the target architecture *)
2010-03-11 06:36 by benjk -
Changed line 59 from:
  (* returns the significance value of the n-th octet in a four octet value
to:
  (* returns the significance of the n-th octet in a four octet value
2010-03-11 06:35 by benjk -
Changed lines 59-60 from:
  (* returns a value between 0 and 3 indicating the index at which the n-th octet
     of a four-octet value is stored in the target architecture *)
to:
  (* returns the significance value of the n-th octet in a four octet value
 
  as it is used by the storage model of the target architecture *)
2010-03-11 06:32 by benjk -
Added lines 57-60:

PROCEDURE TargetOctetOrder( n : OCTET ) : OCTET;
  (* returns a value between 0 and 3 indicating the index at which the n-th octet
    of a four-octet value is stored in the target architecture *)
2010-03-11 04:47 by benjk -
Changed lines 47-53 from:
     (* target dependent name of the target architecture *)

    TargetIsBigEndian = <target dependent boolean value>;
      (* TRUE if target architecture is big endian, otherwise FALSE *)

   TargetIsLittleEndian = <target dependent boolean value>;
     (* TRUE if target architecture is little endian, otherwise FALSE *)
to:
     (* name of the target architecture *)

    TargetEndianess = <target dependent value>;
      (* endianness of the target architecture,
   
    any of NonEndian, BigEndian, LittleEndian or MixedEndian *)

    NonEndian = <implementation defined constant>;
    BigEndian = <implementation defined constant>;
    LittleEndian = <implementation defined constant>;
    MixedEndian = <implementation defined constant>;
2010-03-11 04:15 by benjk -
Added lines 41-53:


(* information about the target architecture *)

CONST
    TargetName =  <target dependent string value>;
      (* target dependent name of the target architecture *)

    TargetIsBigEndian = <target dependent boolean value>;
      (* TRUE if target architecture is big endian, otherwise FALSE *)

    TargetIsLittleEndian = <target dependent boolean value>;
      (* TRUE if target architecture is little endian, otherwise FALSE *)
2010-03-10 16:57 by benjk -
Changed lines 135-136 from:
  (* returns the position of the least significant bit of x *)
to:
  (* returns the position of the least significant set bit of x *)
Changed line 138 from:
  (* returns the position of the most significant bit of x *)
to:
  (* returns the position of the most significant set bit of x *)
2010-03-10 14:09 by benjk -
Changed line 28 from:
   MachineBytesPerMachineWord = <tartget dependent value>;
to:
   MachineBytesPerMachineWord = <target dependent value>;
Changed lines 62-63 from:
  (* increments the value of operand x by n *)
to:
  (* increments the value of operand x by n, ignoring overflow *)
Changed line 65 from:
  (* decrements the value of operand x by n *)
to:
  (* decrements the value of operand x by n, ignoring overflow *)
2010-03-10 13:51 by benjk -
Changed line 140 from:
PROCEDURE CSB( x : <AnyType> ) : TypeOf(x);
to:
PROCEDURE CSBITS( x : <AnyType> ) : TypeOf(x);
2010-03-10 13:46 by benjk -
Changed line 126 from:
  (* sets bit n of x if bitval is TRUE, clears if FALSE *)
to:
  (* sets bit n of x if bitval is TRUE, otherwise clears it *)
2010-03-10 13:45 by benjk -
Changed line 55 from:
   WordsPerOperand = <implementation defined value greater or equal 4>
to:
   WordsPerOperand = <implementation defined value greater or equal 4>;
2010-03-10 13:44 by benjk -
Changed line 55 from:
   WordsPerOperand = <implementation defined value>; (* min: 4 *)
to:
   WordsPerOperand = <implementation defined value greater or equal 4>
2010-03-10 13:43 by benjk -
Changed lines 108-109 from:
  (* returns the bitwise logical AND of operand x and operand y *)
to:
  (* returns the bitwise logical AND of operands x and y *)
Changed lines 111-112 from:
  (* returns the bitwise logical OR of operand x and operand y *)
to:
  (* returns the bitwise logical OR of operands x and y *)
Changed lines 114-115 from:
  (* returns the bitwise logical exclusive OR of operand x and operand y *)
to:
  (* returns the bitwise logical exclusive OR of operands x and y *)
Changed lines 117-118 from:
  (* returns the inverted bitwise logical AND of operand x and operand y *)
to:
  (* returns the inverted bitwise logical AND of operands x and y *)
Changed lines 120-122 from:
  (* returns the inverted bitwise logical OR of operand x and operand y *)

to:
  (* returns the inverted bitwise logical OR of operands x and y *)

Changed line 125 from:
PROCEDURE SETBIT( x : <AnyType>; n : OCTET; bit : BOOLEAN );
to:
PROCEDURE SETBIT( VAR x : <AnyType>; n : OCTET; bit : BOOLEAN );
2010-03-10 13:34 by benjk -
Changed lines 55-56 from:
   WordsPerOperand = <implementation defined value>;
     (* size of operands in machine level operations *)
to:
   WordsPerOperand = <implementation defined value>; (* min: 4 *)
     (* size of largest supported operand in machine level operations *)
2010-03-10 13:32 by benjk -
Changed lines 140-141 from:
PROCEDURE BITCOUNT( x : <AnyType> ) : TypeOf(x);
  (* counts the number of bits in x that are set and returns it *)
to:
PROCEDURE CSB( x : <AnyType> ) : TypeOf(x);
  (* counts and returns the number of set bits in x *)
2010-03-10 13:25 by benjk -
Changed lines 123-125 from:
(* bit positions *)

PROCEDURE LSBIT( x : <AnyType>) : TypeOf(x);
to:
(* single bit operations *)

PROCEDURE SETBIT( x : <AnyType>; n : OCTET; bit : BOOLEAN );
  (* sets bit n of x if bitval is TRUE, clears if FALSE *)

PROCEDURE TESTBIT( x : <AnyType>; n : OCTET ) : BOOLEAN;
  (* returns TRUE if bit n of x is set, otherwise FALSE *)


(* bit tests *)

PROCEDURE LSBIT( x : <AnyType>
) : TypeOf(x);
Changed line 137 from:
PROCEDURE MSBIT( x : <AnyType>) : TypeOf(x);
to:
PROCEDURE MSBIT( x : <AnyType> ) : TypeOf(x);
Added lines 139-141:

PROCEDURE BITCOUNT( x : <AnyType> ) : TypeOf(x);
  (* counts the number of bits in x that are set and returns it *)
2010-03-10 13:13 by benjk -
Deleted lines 120-219:

[@DEFINITION MODULE SYSTEM;

  (* Pseudo module for access to system dependent resources *)


(* implementation defined types *)

CONST
    OctetsPerByte = <implementation defined value>;
      (* size of a virtual byte *)

    BytesPerWord = <implementation defined value>;
      (* size of a virtual word *)


TYPE
    BYTE;  (* virtual byte with a bit width divisible by eight *)

    WORD = ARRAY BytesPerWord OF BYTE;  (* virtual word *)


(* target dependent machine types *)

CONST
    BitsPerMachineByte = <target dependent value>;
      (* size of smallest addressable unit *)

    MachineBytesPerMachineWord = <tartget dependent value>;
      (* size of of a machine word *)

    OctetsPerMachineWord = <target dependent value>;
      (* number of octets required to store a machine word *)


TYPE
    MACHINEBYTE;  (* target dependent byte *)

    MACHINEWORD = ARRAY MachineBytesPerMachineWord OF MACHINEBYTE;

    ADDRESS; (* target dependent machine address *)


(* general system level facilities *)

PROCEDURE ADR( var : <AnyType> ) : ADDRESS;
  (* returns the address of variable var *)

PROCEDURE CAST( <AnyTargetType>; val : <AnyType> ) : <TargetType>;
  (* returns the value of val, cast to the target type *)


(* machine level operations *)

CONST
    WordsPerOperand = <implementation defined value>;
      (* size of operands in machine level operations *)


(* machine level arithmetic *)

PROCEDURE INC( VAR x : <AnyType>; n : OCTET );
  (* increments the value of operand x by n *)

PROCEDURE DEC( VAR x : <AnyType>; n : OCTET );
  (* decrements the value of operand x by n *)

PROCEDURE ADDC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* adds operand y to operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)

PROCEDURE SUBC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* subtracts operand y from operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)


(* shift operations *)

PROCEDURE SHL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x shifted left by n bits *)

PROCEDURE SHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x logically shifted right by n bits *)

PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x arithmetically shifted right by n bits *)

PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits *)

PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits *)

PROCEDURE ROTLC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)

PROCEDURE ROTRC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)
2010-03-10 13:06 by benjk -
Added lines 121-229:

[@DEFINITION MODULE SYSTEM;

  (* Pseudo module for access to system dependent resources *)


(* implementation defined types *)

CONST
    OctetsPerByte = <implementation defined value>;
      (* size of a virtual byte *)

    BytesPerWord = <implementation defined value>;
      (* size of a virtual word *)


TYPE
    BYTE;  (* virtual byte with a bit width divisible by eight *)

    WORD = ARRAY BytesPerWord OF BYTE;  (* virtual word *)


(* target dependent machine types *)

CONST
    BitsPerMachineByte = <target dependent value>;
      (* size of smallest addressable unit *)

    MachineBytesPerMachineWord = <tartget dependent value>;
      (* size of of a machine word *)

    OctetsPerMachineWord = <target dependent value>;
      (* number of octets required to store a machine word *)


TYPE
    MACHINEBYTE;  (* target dependent byte *)

    MACHINEWORD = ARRAY MachineBytesPerMachineWord OF MACHINEBYTE;

    ADDRESS; (* target dependent machine address *)


(* general system level facilities *)

PROCEDURE ADR( var : <AnyType> ) : ADDRESS;
  (* returns the address of variable var *)

PROCEDURE CAST( <AnyTargetType>; val : <AnyType> ) : <TargetType>;
  (* returns the value of val, cast to the target type *)


(* machine level operations *)

CONST
    WordsPerOperand = <implementation defined value>;
      (* size of operands in machine level operations *)


(* machine level arithmetic *)

PROCEDURE INC( VAR x : <AnyType>; n : OCTET );
  (* increments the value of operand x by n *)

PROCEDURE DEC( VAR x : <AnyType>; n : OCTET );
  (* decrements the value of operand x by n *)

PROCEDURE ADDC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* adds operand y to operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)

PROCEDURE SUBC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
  (* subtracts operand y from operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)


(* shift operations *)

PROCEDURE SHL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x shifted left by n bits *)

PROCEDURE SHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x logically shifted right by n bits *)

PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x arithmetically shifted right by n bits *)

PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits *)

PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits *)

PROCEDURE ROTLC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated left by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)

PROCEDURE ROTRC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
  (* returns the value of operand x rotated right by n bits,
    rotating through n bits of c, passing the rotated out bits back in c *)


(* bit positions *)

PROCEDURE LSBIT( x : <AnyType>) : TypeOf(x);
  (* returns the position of the least significant bit of x *)

PROCEDURE MSBIT( x : <AnyType>) : TypeOf(x);
  (* returns the position of the most significant bit of x *)
2010-03-10 12:52 by benjk -
Changed line 67 from:
PROCEDURE ADDC( VAR x : <AnyType>; y : `TypeOf(x); VAR c : BOOLEAN );
to:
PROCEDURE ADDC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
Changed line 71 from:
PROCEDURE SUBC( VAR x : <AnyType>; y : `TypeOf(x); VAR c : BOOLEAN );
to:
PROCEDURE SUBC( VAR x : <AnyType>; y : TypeOf(x); VAR c : BOOLEAN );
Changed line 78 from:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : TypeOf(x);
Changed line 81 from:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
Changed line 84 from:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : TypeOf(x);
Changed line 87 from:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : TypeOf(x);
Changed line 90 from:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : TypeOf(x);
Changed line 93 from:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE ROTLC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
Changed line 97 from:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : `TypeOf(x);
to:
PROCEDURE ROTRC( x : <AnyType>; VAR c : TypeOf(x); n : OCTET ) : TypeOf(x);
Changed line 104 from:
PROCEDURE BWNOT( x : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWNOT( x : <AnyType> ) : TypeOf(x);
Changed line 107 from:
PROCEDURE BWAND( x, y : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWAND( x, y : <AnyType> ) : TypeOf(x);
Changed line 110 from:
PROCEDURE BWOR( x, y : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWOR( x, y : <AnyType> ) : TypeOf(x);
Changed line 113 from:
PROCEDURE BWXOR( x, y : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWXOR( x, y : <AnyType> ) : TypeOf(x);
Changed line 116 from:
PROCEDURE BWNAND( x, y : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWNAND( x, y : <AnyType> ) : TypeOf(x);
Changed line 119 from:
PROCEDURE BWNOR( x, y : <AnyType> ) : `TypeOf(x);
to:
PROCEDURE BWNOR( x, y : <AnyType> ) : TypeOf(x);
2010-03-10 12:51 by benjk -
Changed line 67 from:
PROCEDURE ADDC( VAR x : <AnyType>; y : <type of x>; VAR c : BOOLEAN );
to:
PROCEDURE ADDC( VAR x : <AnyType>; y : `TypeOf(x); VAR c : BOOLEAN );
Changed line 71 from:
PROCEDURE SUBC( VAR x : <AnyType>; y : <type of x>; VAR c : BOOLEAN );
to:
PROCEDURE SUBC( VAR x : <AnyType>; y : `TypeOf(x); VAR c : BOOLEAN );
Changed line 78 from:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : <type of x>;
to:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : `TypeOf(x);
Changed line 81 from:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : <type of x>;
to:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
Changed line 84 from:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : <type of x>;
to:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
Changed line 87 from:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : <type of x>;
to:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : `TypeOf(x);
Changed line 90 from:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : <type of x>;
to:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : `TypeOf(x);
Changed line 93 from:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <type of x>;
to:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : `TypeOf(x);
Changed line 97 from:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <type of x>;
to:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : `TypeOf(x);
Changed line 104 from:
PROCEDURE BWNOT( x : <AnyType> ) : <type of x>;
to:
PROCEDURE BWNOT( x : <AnyType> ) : `TypeOf(x);
Changed line 107 from:
PROCEDURE BWAND( x, y : <AnyType> ) : <type of x and y>;
to:
PROCEDURE BWAND( x, y : <AnyType> ) : `TypeOf(x);
Changed line 110 from:
PROCEDURE BWOR( x, y : <AnyType> ) : <type of x and y>;
to:
PROCEDURE BWOR( x, y : <AnyType> ) : `TypeOf(x);
Changed line 113 from:
PROCEDURE BWXOR( x, y : <AnyType> ) : <type of x and y>;
to:
PROCEDURE BWXOR( x, y : <AnyType> ) : `TypeOf(x);
Changed line 116 from:
PROCEDURE BWNAND( x, y : <AnyType> ) : <type of x and y>;
to:
PROCEDURE BWNAND( x, y : <AnyType> ) : `TypeOf(x);
Changed line 119 from:
PROCEDURE BWNOR( x, y : <AnyType> ) : <type of x and y>;
to:
PROCEDURE BWNOR( x, y : <AnyType> ) : `TypeOf(x);
2010-03-10 12:48 by benjk -
Changed lines 95-96 from:
     rotating through n bits of c *)
to:
     rotating through n bits of c, passing the rotated out bits back in c *)
Changed line 99 from:
     rotating through n bits of c *)
to:
     rotating through n bits of c, passing the rotated out bits back in c *)
2010-03-10 12:45 by benjk -
Changed line 78 from:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : <AnyType>;
to:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : <type of x>;
Changed line 81 from:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : <AnyType>;
to:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : <type of x>;
Changed line 84 from:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : <type of x>;
Changed line 87 from:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : <type of x>;
Changed line 90 from:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : <type of x>;
Changed line 93 from:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <type of x>;
Changed line 97 from:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <type of x>;
Changed line 104 from:
PROCEDURE BWNOT( x : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNOT( x : <AnyType> ) : <type of x>;
Changed line 107 from:
PROCEDURE BWAND( x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWAND( x, y : <AnyType> ) : <type of x and y>;
Changed line 110 from:
PROCEDURE BWOR( x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWOR( x, y : <AnyType> ) : <type of x and y>;
Changed line 113 from:
PROCEDURE BWXOR( x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWXOR( x, y : <AnyType> ) : <type of x and y>;
Changed line 116 from:
PROCEDURE BWNAND( x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNAND( x, y : <AnyType> ) : <type of x and y>;
Changed line 119 from:
PROCEDURE BWNOR( x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNOR( x, y : <AnyType> ) : <type of x and y>;
2010-03-10 12:42 by benjk -
Changed lines 68-70 from:
  (* adds operands y to operand x and adds 1 if TRUE is passed in for c,
    passes the result back in x and passes the carry bit back in c *)
to:
  (* adds operand y to operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)
Changed lines 72-73 from:
  (* subtracts operand y from operand x and adds 1 if TRUE is passed in for c,
    passes the result back in x and passes the carry bit back in c *)
to:
  (* subtracts operand y from operand x, adds 1 if TRUE is passed in for c,
    then passes the result back in x and the carry bit back in c *)
2010-03-10 12:40 by benjk -
Changed lines 9-13 from:
   OctetsPerByte = <implementation defined size of a virtual byte>;

   BytesPerWord = <implementation defined size of a virtual word>;

to:
   OctetsPerByte = <implementation defined value>;
   
  (* size of a virtual byte *)

    BytesPerWord = <implementation defined value
>;
      (* size of a virtual word *)


Changed lines 25-31 from:
   BitsPerMachineByte = <target dependent size of smallest addressable unit>;

   MachineBytesPerMachineWord = <tartget dependent size of a machine word>;

   OctetsPerMachineWord = <number of octets required to store a machine word>;

to:
   BitsPerMachineByte = <target dependent value>;
   
  (* size of smallest addressable unit *)

    MachineBytesPerMachineWord = <tartget dependent value>;
     (* size of of a machine word *)

    OctetsPerMachineWord = <target dependent value
>;
      (* number of octets required to store a machine word *)


Changed lines 48-49 from:
PROCEDURE CAST( <AnyTargetType>; val : <AnyType> ) : <AnyTargetType>;
  (* returns the value of val cast to the target type *)
to:
PROCEDURE CAST( <AnyTargetType>; val : <AnyType> ) : <TargetType>;
  (* returns the value of val, cast to the target type *)
2010-03-10 12:36 by benjk -
Changed line 92 from:
PROCEDURE ROTRC( x, c : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTRC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
2010-03-10 12:35 by benjk -
Changed line 62 from:
PROCEDURE ADDC( VAR x : <AnyType>; y : <same type as x>; VAR c : BOOLEAN );
to:
PROCEDURE ADDC( VAR x : <AnyType>; y : <type of x>; VAR c : BOOLEAN );
Changed line 66 from:
PROCEDURE SUBC( VAR x : <AnyType>; y : <same type as x>; VAR c : BOOLEAN );
to:
PROCEDURE SUBC( VAR x : <AnyType>; y : <type of x>; VAR c : BOOLEAN );
Changed line 88 from:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <same type as x>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
Changed line 92 from:
PROCEDURE ROTRC( x, c : <AnyType>; VAR c : <same type as x>; n : OCTET ) : <AnyType>;
to:
PROCEDURE ROTRC( x, c : <AnyType>; VAR c : <type of x>; n : OCTET ) : <AnyType>;
2010-03-10 12:34 by benjk -
Changed lines 88-92 from:
PROCEDURE ROTLC( x, c : <AnyType>; n : OCTET ) : <AnyType>;
  (* returns the value of operand x rotated left by n bits through n bits of c *)

PROCEDURE ROTRC( x, c : <AnyType>;
n : OCTET ) : <AnyType>;
  (* returns the value of operand x rotated right by
n bits through n bits of c *)
to:
PROCEDURE ROTLC( x : <AnyType>; VAR c : <same type as x>; n : OCTET ) : <AnyType>;
  (* returns the value of operand x rotated left by n bits,
 
  rotating through n bits of c *)

PROCEDURE ROTRC( x, c : <AnyType>; VAR c : <same type as x>;
n : OCTET ) : <AnyType>;
  (* returns the value of operand x rotated right by n bits,
    rotating
through n bits of c *)
2010-03-10 12:29 by benjk -
Changed lines 98-99 from:
  (* returns the logical NOT of operand x *)
to:
  (* returns the bitwise logical NOT of operand x *)
Changed lines 101-102 from:
  (* returns the logical AND of operand x and operand y *)
to:
  (* returns the bitwise logical AND of operand x and operand y *)
Changed lines 104-105 from:
  (* returns the logical OR of operand x and operand y *)
to:
  (* returns the bitwise logical OR of operand x and operand y *)
Changed lines 107-108 from:
  (* returns the logical exclusive OR of operand x and operand y *)
to:
  (* returns the bitwise logical exclusive OR of operand x and operand y *)
Changed lines 110-111 from:
  (* returns the negated logical AND of operand x and operand y *)
to:
  (* returns the inverted bitwise logical AND of operand x and operand y *)
Changed line 113 from:
  (* returns the negated logical OR of operand x and operand y *)
to:
  (* returns the inverted bitwise logical OR of operand x and operand y *)
2010-03-10 12:27 by benjk -
Changed line 97 from:
PROCEDURE BWNOT( VAR x : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNOT( x : <AnyType> ) : <AnyType>;
Changed line 100 from:
PROCEDURE BWAND( VAR x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWAND( x, y : <AnyType> ) : <AnyType>;
Changed line 103 from:
PROCEDURE BWOR( VAR x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWOR( x, y : <AnyType> ) : <AnyType>;
Changed line 106 from:
PROCEDURE BWXOR( VAR , y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWXOR( x, y : <AnyType> ) : <AnyType>;
Changed line 109 from:
PROCEDURE BWNAND( VAR x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNAND( x, y : <AnyType> ) : <AnyType>;
Changed line 112 from:
PROCEDURE BWNOR( VAR x, y : <AnyType> ) : <AnyType>;
to:
PROCEDURE BWNOR( x, y : <AnyType> ) : <AnyType>;
2010-03-10 12:26 by benjk -
Changed line 73 from:
PROCEDURE SHL( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE SHL( x : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 76 from:
PROCEDURE SHR( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE SHR( x : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 79 from:
PROCEDURE ASHR( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ASHR( x : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 82 from:
PROCEDURE ROTL( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ROTL( x : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 85 from:
PROCEDURE ROTR( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ROTR( x : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 88 from:
PROCEDURE ROTLC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ROTLC( x, c : <AnyType>; n : OCTET ) : <AnyType>;
Changed line 91 from:
PROCEDURE ROTRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ROTRC( x, c : <AnyType>; n : OCTET ) : <AnyType>;
2010-03-10 12:21 by benjk -
Changed line 63 from:
  (* adds operands x, y, adds 1 if carry bit c is TRUE,
to:
  (* adds operands y to operand x and adds 1 if TRUE is passed in for c,
Changed line 67 from:
  (* subtracts operand y from operand x and adds 1 if carry bit c is TRUE,
to:
  (* subtracts operand y from operand x and adds 1 if TRUE is passed in for c,
2010-03-10 12:19 by benjk -
Changed lines 63-64 from:
  (* adds operands x, y and carry bit c, passes result in x,  passes carry bit in c *)
to:
  (* adds operands x, y, adds 1 if carry bit c is TRUE,
 
   passes the result back in x and passes the carry bit back in c *)
Changed lines 67-68 from:
  (* subtracts y and carry bit c from x, passes result in x,  passes carry bit in c *)
to:
  (* subtracts operand y from operand x and adds 1 if carry bit c is TRUE,
    passes the result back in x and passes the carry bit back
in c *)
2010-03-10 12:16 by benjk -
Changed lines 63-64 from:
  (* increments the value of operand x by n and returns carry bit in c *)
to:
  (* adds operands x, y and carry bit c, passes result in x,  passes carry bit in c *)
Changed line 66 from:
  (* decrements the value of operand x by n and returns carry bit in c *)
to:
  (* subtracts y and carry bit c from x, passes result in x,  passes carry bit in c *)
2010-03-10 11:52 by benjk -
Changed line 56 from:
PROCEDURE INC( VAR x : <AnyType>; n : CARDINAL);
to:
PROCEDURE INC( VAR x : <AnyType>; n : OCTET );
Changed line 59 from:
PROCEDURE DEC( VAR x : <AnyType>; n : CARDINAL);
to:
PROCEDURE DEC( VAR x : <AnyType>; n : OCTET );
Added lines 61-66:

PROCEDURE ADDC( VAR x : <AnyType>; y : <same type as x>; VAR c : BOOLEAN );
  (* increments the value of operand x by n and returns carry bit in c *)

PROCEDURE SUBC( VAR x : <AnyType>; y : <same type as x>; VAR c : BOOLEAN );
  (* decrements the value of operand x by n and returns carry bit in c *)
2010-03-10 10:10 by benjk -
Deleted lines 73-84:
PROCEDURE SHLC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x shifted left by n bits
    and passes back the shifted out bits in c *)

PROCEDURE SHRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x logically shifted right by n bits
    and passes back the shifted out bits in c *)

PROCEDURE ASHRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x arithmetically shifted right by n bits
    and passes back the shifted out bits in c *)

Added lines 79-84:

PROCEDURE ROTLC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated left by n bits through n bits of c *)

PROCEDURE ROTRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated right by n bits through n bits of c *)
2010-03-10 09:56 by benjk -
Changed lines 75-76 from:
  (* returns the value of operand x shifted left by n bits, returns carry bits in c *)
to:
  (* returns the value of operand x shifted left by n bits
     and passes back the shifted out bits in c *)
Changed lines 79-80 from:
  (* returns the value of operand x logically shifted right by n bits, returns carry bits in c *)
to:
  (* returns the value of operand x logically shifted right by n bits
     and passes back the shifted out bits in c *)
Changed lines 83-84 from:
  (* returns the value of operand x arithmetically shifted right by n bits, returns carry bits in c *)
to:
  (* returns the value of operand x arithmetically shifted right by n bits
     and passes back the shifted out bits in c *)
2010-03-10 09:53 by benjk -
Changed lines 63-64 from:
(* bitwise operations *)
to:
(* shift operations *)
Added lines 74-82:
PROCEDURE SHLC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x shifted left by n bits, returns carry bits in c *)

PROCEDURE SHRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x logically shifted right by n bits, returns carry bits in c *)

PROCEDURE ASHRC( VAR x, c : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x arithmetically shifted right by n bits, returns carry bits in c *)

Changed lines 89-93 from:
PROCEDURE ROTLC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated left through carry bit c by n bits *)

PROCEDURE ROTRC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated right through carry bit c by n bits
*)
to:

(* bitwise operations *)
2010-03-10 09:14 by benjk -
Changed line 83 from:
PROCEDURE ROTLC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
to:
PROCEDURE ROTRC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
2010-03-10 09:13 by benjk -
Changed lines 75-76 from:
  (* returns the value of operand x rotated by n bits to the left *)
to:
  (* returns the value of operand x rotated left by n bits *)
Changed lines 78-84 from:
  (* returns the value of operand x rotated by n bits to the right *)
to:
  (* returns the value of operand x rotated right by n bits *)

PROCEDURE ROTLC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated left through carry bit c by n bits *)

PROCEDURE ROTLC( VAR x : <AnyType>; VAR c : CARDINAL; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated right through carry bit c by n bits
*)
2010-03-10 08:59 by benjk -
Changed lines 66-67 from:
  (* returns the value of operand x shifted by n bits to the left *)
to:
  (* returns the value of operand x shifted left by n bits *)
Changed lines 69-70 from:
  (* returns the value of operand x logically shifted by n bits to the right *)
to:
  (* returns the value of operand x logically shifted right by n bits *)
Changed line 72 from:
  (* returns the value of operand x arithmetically shifted by n bits to the right *)
to:
  (* returns the value of operand x arithmetically shifted right by n bits *)
2010-03-10 08:56 by benjk -
Changed lines 69-72 from:
  (* returns the value of operand x shifted by n bits to the right *)
to:
  (* returns the value of operand x logically shifted by n bits to the right *)

PROCEDURE ASHR( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x arithmetically
shifted by n bits to the right *)
2010-03-10 08:38 by benjk -
Changed lines 47-48 from:
(* machine level arithmetic *)
to:
(* machine level operations *)
Added lines 52-54:


(* machine level arithmetic *)
2010-03-10 08:36 by benjk -
Added lines 5-7:

(* implementation defined types *)

Changed lines 9-19 from:
   OctetsPerByte = <implementation dependent size of a virtual byte>;

    BytesPerWord = <implementation dependent size of a virtual word>;

    BitsPerMachineByte = <target dependent size of smallest addressable unit>;

    MachineBytesPerMachineWord = <tartget dependent size of a machine word>;

    OctetsPerMachineWord = <number of octets required to store a machine
word>;

to:
   OctetsPerByte = <implementation defined size of a virtual byte>;

    BytesPerWord = <implementation defined size of a virtual word>;

Changed lines 15-26 from:

(* virtual storage allocation units *)

    BYTE;  (* bit width divisible by eight
*)

    WORD = ARRAY BytesPerWord OF BYTE;

   ADDRESS; (* target dependent virtual address *)


(* physical storage allocation units *)

to:
    BYTE;  (* virtual byte with a bit width divisible by eight *)

    WORD = ARRAY BytesPerWord OF BYTE;  (* virtual word *)


(*
target dependent machine types *)

CONST
    BitsPerMachineByte = <target dependent size of smallest addressable unit>;

    MachineBytesPerMachineWord = <tartget dependent size of a machine word>;

    OctetsPerMachineWord = <number of octets required to store a machine word>;


TYPE
Changed lines 35-37 from:
   MACHINEADDRESS; (* target dependent machine address *)

to:
   ADDRESS; (* target dependent machine address *)


(* general system level facilities *)

Changed lines 41-71 from:

PROCEDURE CAST( <TargetType>; value : <AnyType> ) : <TargetType>;


 (
* bitwise operations *)

PROCEDURE SHL( VAR v
: <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE SHR( VAR v : <OrdinalType>; n : CARDINAL
) : <OrdinalType>;

PROCEDURE ROTL( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType
>;

PROCEDURE ROTR( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE BWNOT( VAR x : <OrdinalType> ) :
<OrdinalType>;

PROCEDURE BWAND( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWOR( VAR
x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWXOR( VAR x, y
: <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWNAND
( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWNOR
( VAR x, y : <OrdinalType> ) : <OrdinalType>;

 (* machine level arithmetic
*)

PROCEDURE INC( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE DEC( VAR v : <OrdinalType>; n : CARDINAL)
: <OrdinalType>;
to:
  (* returns the address of variable var *)

PROCEDURE CAST( <AnyTargetType>; val : <AnyType> )
: <AnyTargetType>;
  (* returns the value of val cast to the target type *)


(* machine level arithmetic *)

CONST
 
  WordsPerOperand = <implementation defined value>;
     (* size of operands in machine level operations *)

PROCEDURE INC( VAR x :
<AnyType>; n : CARDINAL);
  (* increments the value of operand
x by n *)

PROCEDURE DEC( VAR x : <AnyType>; n
: CARDINAL);
  (* decrements the value of operand x by n *)


(* bitwise operations *)

PROCEDURE SHL( VAR x
: <AnyType>; n : CARDINAL) : <AnyType>;
  (
* returns the value of operand x shifted by n bits to the left *)

PROCEDURE SHR( VAR x
: <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x shifted by n bits to the right *)

PROCEDURE ROTL( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated by n bits to the left *)

PROCEDURE ROTR( VAR x : <AnyType>; n : CARDINAL) : <AnyType>;
  (* returns the value of operand x rotated by n bits to the right *)

PROCEDURE BWNOT( VAR x : <AnyType> ) : <AnyType>;
  (* returns the logical NOT of operand x *)

PROCEDURE BWAND( VAR x, y : <AnyType> ) : <AnyType>;
  (* returns the logical AND of operand x and operand y *)

PROCEDURE BWOR( VAR x, y : <AnyType> ) : <AnyType>;
  (* returns the logical OR of operand x and operand y *)

PROCEDURE BWXOR( VAR , y : <AnyType> ) : <AnyType>;
  (* returns the logical exclusive OR of operand x and operand y *)

PROCEDURE BWNAND( VAR x, y : <AnyType> ) : <AnyType>;
  (* returns the negated logical AND of operand x and operand y *)

PROCEDURE BWNOR( VAR x, y : <AnyType> ) : <AnyType>;
  (* returns the negated logical OR of operand x and operand y *)

2010-03-09 19:14 by benjk -
Changed line 37 from:
PROCEDURE ADR( VAR v : <AnyType> ) : ADDRESS;
to:
PROCEDURE ADR( var : <AnyType> ) : ADDRESS;
2010-03-09 19:10 by benjk -
Deleted lines 18-22:
(* system independent portable byte, should it be pervasive? *)

    OCTET;  (* always 8-bit *)

Changed lines 44-66 from:
PROCEDURE SHL( VAR v : <Type>; n : CARDINAL) : <Type>;

PROCEDURE SHR( VAR v : <Type>; n : CARDINAL) : <Type>;

PROCEDURE ROTL( VAR v : <Type>; n : CARDINAL) : <Type>;

PROCEDURE ROTR( VAR v : <Type>; n : CARDINAL) : <Type>;

PROCEDURE BWNOT( VAR x : <Type> ) : <Type>;

PROCEDURE BWAND( VAR x, y : <Type> ) : <Type>;

PROCEDURE BWNAND( VAR x, y : <Type> ) : <Type>;

PROCEDURE BWOR( VAR x, y : <Type> ) : <Type>;

PROCEDURE BWNOR( VAR x, y : <Type> ) : <Type>;

PROCEDURE BWXOR( VAR x, y : <Type> ) : <Type>;

PROCEDURE INC( VAR v : <Type>; n : CARDINAL) : <Type>;

PROCEDURE DEC( VAR v
: <Type>; n : CARDINAL) : <Type>;
to:
PROCEDURE SHL( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE SHR( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE ROTL( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE ROTR( VAR v : <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE BWNOT( VAR x : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWAND( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWOR( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWXOR( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWNAND( VAR x, y : <OrdinalType> ) : <OrdinalType>;

PROCEDURE BWNOR( VAR x, y : <OrdinalType> ) : <OrdinalType>;

 (* machine level arithmetic *)

PROCEDURE INC( VAR v
: <OrdinalType>; n : CARDINAL) : <OrdinalType>;

PROCEDURE DEC( VAR v
: <OrdinalType>; n : CARDINAL) : <OrdinalType>;