File: dbf\unsigned.ads
1 --::::::::::
2 --unsigned.ads
3 --::::::::::
4 -- Developed by (C) Wasiliy W. Molostoff 1994, 1995.
5 -- Moscow, Russia,
6 -- Voice: 7 (095) 398-23-38
7 -- e-mail: edv@edv.msk.ru
8 -- This is free software; you can freely redistribute it and/or
9 -- modify it without any restrictions. Please report any errors.
10 -- All corrections will be made as soon as possible.
11 package unsigned is
12
13 -- type byte is mod 2** 8; for byte'size use 8;
14 -- type word is mod 2**16; for word'size use 16;
15 -- type long_word is mod 2**32; for long_word'size use 32;
16
17 type byte is range 0 .. (2**8 - 1); for byte'size use 8;
18 type word is range 0 .. (2**16 - 1); for word'size use 16;
19 type long_word is range 0 .. (2**31 - 1); for long_word'size use 32;
20 -- type long_word is new long_integer; for long_word'size use 32;
21
22 type byte_string is array (positive range <>) of byte;
23 subtype word_bytes is byte_string (1..2);
24 subtype long_word_bytes is byte_string (1..4);
25
26 function value (item: byte_string) return standard.string;
27 pragma inline (value);
28
29 function value (item: standard.string) return byte_string;
30 pragma inline (value);
31
32 function value (item: word_bytes) return word;
33 function value (item: word) return word_bytes;
34
35 function value (item: long_word_bytes) return long_word;
36 function value (item: long_word) return long_word_bytes;
37
38 end unsigned;
39