-- FILE: utility.adb -- DATE: 7/98 -- AUTHOR: Sy Wong -- MODIFIED BY: G. Levine 8/98 -- AIM: output utilities with TEXT_IO; -- These programs were compiled with and without a -- gnat83 switch and also with an Ada 83 compiler package body UTILITY is procedure putb (s: boolean) is begin if s then TEXT_IO.put ('1'); else TEXT_IO.put ('0'); end if; end putb; pragma inline (putb); procedure put (s: boolean) is begin putb (s); TEXT_IO.put(" "); end put; procedure putms1st (b: hdl.bus) is begin for i in reverse b'range loop putb(b(i)); end loop; TEXT_IO.put(" "); end putms1st; function str (b: HDL.bus) return string is s: string (1..b'last+1); begin for i in reverse b'range loop if b(i) then s(s'last -i):= '1'; else s(s'last -i):= '0'; end if; end loop; return s; end str; end UTILITY;