fork download
  1. with Ada.Text_IO, Interfaces;
  2. use Ada.Text_IO, Interfaces;
  3.  
  4. procedure test is
  5. package Unsigned_16_IO is new Ada.Text_Io.Modular_IO(Unsigned_16);
  6. a: Unsigned_8 := 16#12#;
  7. b: Unsigned_8 := 16#34#;
  8. c: Unsigned_16 := 16#0000#;
  9.  
  10. begin
  11. c := c or Shift_Left(Interfaces.Unsigned_16(a), 8);
  12. c := c or Shift_Left(Interfaces.Unsigned_16(b), 0);
  13. Put("c is ");
  14. Unsigned_16_IO.Put(Item => c, Base => 16);
  15. New_Line;
  16. end test;
Success #stdin #stdout 0s 4332KB
stdin
Standard input is empty
stdout
c is 16#1234#