DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3121b3cd1⟧ TextFile

    Length: 1765 (0x6e5)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦9b7f001df⟧ 
            └─⟦this⟧ 

TextFile

--	Routines to convert two's-complement integers to and from their
--	unsigned hex representations.
--
with unsigned_types;
with machine_types;
package hex is

	function hex_to_integer(
		str:   string) return integer;
	--
	-- Input is a string containing a hex number, possibly with blanks
	-- on either side.  The hex number can have lower or upper case
	-- letters a..f.  The resulting integer will have the bit pattern
	-- represented by the hex number.
	--
	-- Note, input is *not* of the form "16#af2b#", it is in the form "af2b".


	function integer_to_hex(
		int:   integer;
		width: integer := 0;
		fill:  character := ' ') return string;
	--
	--  int    the integer value to be converted to hex 
	--  width  the width of the result (number of ascii characters)
	--  fill   the character to be used to pad the number to the left
	--         if the converted number has fewer characters than "width"
	--         (usually either '0' or ' ').  For example:
	--
	--         integer_to_hex(16#99#, 4, '0') would return "0099". 


	function unsigned_to_hex(
		uint:  unsigned_types.unsigned_integer;
		width: integer := 0;
		fill:  character := ' ') return string;
	--
	--  uint   the unsigned integer value to be converted to hex 
	--  width  the width of the result (number of ascii characters)
	--  fill   the character to be used to pad the number to the left
	--         if the converted number has fewer characters than "width"
	--         (usually either '0' or ' ').  For example:
	--
	--         integer_to_hex(16#99#, 4, '0') would return "0099". 


	function word_to_hex(
			w:		machine_types.word;
			fill:	character := ' '
		)
	return string;


	function byte_to_hex(
			b:		machine_types.byte;
			fill:	character := ' '
		)
	return string;

end hex