/*
**       alarming_clock             -- by Brian Neal   6/24/89
**
**    A simple clock program whoose alarm packs a punch!  Be sure to
**    crank up the stereo for this one.  Illustrates the use of the
**    timer and digitized sound playback.
**    Compiled with Manx Aztec C v3.6
**           cc -n alarming_clock
**           ln -g alarming_clock isup -lc
*/

#include <intuition/intuition.h>
#include <functions.h>
#include <devices/audio.h>
#include <devices/timer.h>
#include <exec/memory.h>
#include <libraries/dos.h>

/*  useful macros */
#define CHAR_WIDTH  (font -> tf_XSize)
#define CHAR_HEIGHT (font -> tf_YSize)

#define WIN_WIDTH 200      /* window constants */
#define WIN_HEIGHT 60

#define BUTT_WIDTH  50     /* gadget constants */
#define BUTT_HEIGHT 14

#define TEST    1          /* GadgetIDs */
#define ALARM   2
#define UP      3
#define DOWN    4
#define HRS_TEN 5
#define HRS_ONE 6
#define MIN_TEN 7
#define MIN_ONE 8

#define ARROW_WIDTH  16     /* arrow dimensions */
#define ARROW_HEIGHT 8

#define MAPRIGHT 0x00000006      /* masks for channel allocation */
#define MAPLEFT  0x00000009

#define SCREAM_PERIOD 400
#define SCREAM_LENGTH 12536      /* length (in bytes) of data file */
                                 /* used CLI's List to get this    */
#define POW_PERIOD 475
#define POW_LENGTH 23632

#define CLOCK_LEFT  ((WIN_WIDTH - (5 * CHAR_WIDTH)) / 2)
#define CLOCK_TOP   12

#define ALARM_LEFT  CLOCK_LEFT
#define ALARM_TOP   24


extern BOOL open_libraries();
extern struct Window *make_window();
extern void init_itext(), *copy_chip();

void shut_down(), init_sounds(), shut_down_audio(), display_time(),
     shut_down_timer(), send_time_request(), init_arrow(), init_image(),
     set_up_display(), sound_alarm(), display_alarm(),
     turn_off_alarm(), init_digit(), adjust_alarm();
UBYTE init_audio();
BOOL read_data(), init_timer(), set_up_window(), time_to_sound(),
     set_up_gadgets();

struct IntuiText test_text, alarm_text, clock_face, alarm_face;
struct Gadget arrow[2];
struct Gadget digit[4];
struct Image  arrow_image[2];

#define ARROW_BYTES 16
USHORT up_image[] = { 0x0000, 0x0180, 0x03c0, 0x07e0,
                      0x0ff0, 0x1ff8, 0x7ffe, 0x0000 };

USHORT down_image[] = { 0x0000, 0x7ffe, 0x1ff8, 0x0ff0,
                        0x07e0, 0x03c0, 0x0180, 0x0000 };


SHORT points[] = { -1, -1,     BUTT_WIDTH, -1,
                   BUTT_WIDTH, BUTT_HEIGHT,
                   -1, BUTT_HEIGHT,    -1, -1 };

struct Border butt_border =
{  0, 0,                                  /*  LeftEdge, TopEdge */
   3, 0,                                  /*  FrontPen, BackPen */
   JAM1,                                  /*  DrawMode          */
   5,                                     /*  Count             */
   &points[0],                            /*  XY                */
   NULL };                                /*  NextBorder        */


struct Gadget test_button =
{  NULL,                                  /*  NextGadget        */
   20, -(BUTT_HEIGHT + 5),                /*  LeftEdge, TopEdge */
   BUTT_WIDTH, BUTT_HEIGHT,               /*  Width, Height     */
   GADGHCOMP | GRELBOTTOM,                /*  Flags             */
   GADGIMMEDIATE | RELVERIFY,             /*  Activation        */
   BOOLGADGET,                            /*  GadgetType        */
   (APTR) &butt_border,                   /*  GadgetRender      */
   NULL,                                  /*  SelectRender      */
   &test_text,                            /*  GadgetText        */
   0L,                                    /*  MutualExclude     */
   NULL,                                  /*  SpecialInfo       */
   TEST,                                  /*  GadgetID          */
   NULL };                                /*  UserData          */

struct Gadget alarm_button =
{  &test_button,
   -(BUTT_WIDTH + 20), -(BUTT_HEIGHT + 5),
   BUTT_WIDTH, BUTT_HEIGHT,
   GADGHCOMP | GRELRIGHT | GRELBOTTOM,
   GADGIMMEDIATE | TOGGLESELECT,
   BOOLGADGET,
   (APTR) &butt_border,
   NULL,
   &alarm_text,
   0L,
   NULL,
   ALARM,
   NULL };

/*  We are going to use topaz.font 80  */
struct TextAttr our_font =
{  (STRPTR) "topaz.font",              /*      ta_Name      */
   8,                                  /*      ta_YSize     */
   FS_NORMAL,                          /*      ta_Style     */
   FPB_ROMFONT };                      /*      ta_Flags     */


struct my_time             /* hours in range of 0..24, minutes in 0..59 */
{
   UBYTE hours, minutes;
};

struct IntuitionBase *IntuitionBase = NULL;
struct GfxBase       *GfxBase       = NULL;
struct TextFont      *font          = NULL;




void main()
{
   struct Window *win = NULL;
   struct IntuiMessage *msg;
   struct IOAudio scream, pow;
   UBYTE channel_mask;
   UBYTE *scream_data = NULL, *pow_data = NULL;
   struct timerequest time_req;
   struct my_time current, alarm;
   struct Gadget *gad;
   ULONG class;
   USHORT active_digit;
   BOOL alarm_set, gad_images = FALSE;

      if (!(open_libraries(33L, 33L)))
         shut_down(10, win, scream_data, pow_data, gad_images);

      if (!(font = (struct TextFont *) OpenFont(&our_font)))
         shut_down(20, win, scream_data, pow_data, gad_images);

      if (!(read_data(&scream_data, &pow_data)))
         shut_down(30, win, scream_data, pow_data, gad_images);

      if (!(gad_images = set_up_gadgets()))
         shut_down(40, win, scream_data, pow_data, gad_images);

      if (!set_up_window(&win))
         shut_down(50, win, scream_data, pow_data, gad_images);

      if ((channel_mask = init_audio(&scream)) == 0)
         shut_down(60, win, scream_data, pow_data, gad_images);

      init_sounds(&scream, &pow, channel_mask, scream_data, pow_data);

      if (!(init_timer(&time_req)))
      {
         shut_down_audio(&scream, channel_mask);
         shut_down(70, win, scream_data, pow_data, gad_images);
      }

      set_up_display(win, &clock_face, &alarm_face);

      /*  Give us a boost in priority  */
      SetTaskPri(FindTask(NULL), 20L);

      alarm_set = FALSE;
      active_digit = MIN_ONE;
      alarm.hours   = 0;
      alarm.minutes = 0;
      display_time(win, &clock_face, &current);
      display_alarm(win, &alarm_face, alarm);
      send_time_request(&time_req);

      FOREVER
      {
         /*
         * if our time request is back, update clock and restart the
         * timer.  If alarm is set, and it is that magic time, sound
         * the alarm.
         */
         if (GetMsg(time_req.tr_node.io_Message.mn_ReplyPort))
         {
            display_time(win, &clock_face, &current);
            send_time_request(&time_req);

            if ((time_to_sound(current, alarm)) && alarm_set)
               sound_alarm(win, &scream, &pow);
         }

         /*  Wait on timer and input from user via window */

         Wait(1L << win -> UserPort -> mp_SigBit |
              1L << time_req.tr_node.io_Message.mn_ReplyPort -> mp_SigBit);

         while (msg = (struct IntuiMessage *) GetMsg(win -> UserPort))
         {
            class = msg -> Class;
            gad = (struct Gadget *) msg -> IAddress;
            ReplyMsg(msg);

            switch (class)
            {
               case CLOSEWINDOW:
                  shut_down_timer(&time_req);
                  shut_down_audio(&scream, channel_mask);
                  shut_down(0, win, scream_data, pow_data, gad_images);
                  break;

               case GADGETUP:    /*  has no meaning; set in gadgets  */
                  break;         /*  only to let user see GADGHCOMP  */

               case GADGETDOWN:
                  switch(gad -> GadgetID)
                  {
                     case ALARM:
                        if (alarm_set)
                        {
                           turn_off_alarm(&alarm_button, win);
                           alarm_set = FALSE;
                        }
                        else
                           alarm_set = TRUE;
                        break;

                     case TEST:
                        sound_alarm(win, &scream, &pow);
                        break;

                     case UP:
                     case DOWN:
                        adjust_alarm(&alarm, active_digit, gad -> GadgetID);
                        display_alarm(win, &alarm_face, alarm);
                        break;

                     case HRS_TEN:
                     case HRS_ONE:
                     case MIN_TEN:
                     case MIN_ONE:
                        active_digit = gad -> GadgetID;
                        break;
                  }
                  break;

               default:
                  break;
            }                 /*  switch */
         }                    /*  while  */
      }                       /* for(;;) */
}                             /*   main  */


/*
**       shut_down()
**          Frees up everything but audio and timer related activiy.
**/

void shut_down(code, win, scream, pow, gad_images)
WORD code;
struct Window *win;
UBYTE *scream, *pow;
BOOL gad_images;
{
   struct IntuiMessage *msg;

      if (gad_images)
      {
         FreeMem(arrow_image[0].ImageData, (ULONG) ARROW_BYTES);
         FreeMem(arrow_image[1].ImageData, (ULONG) ARROW_BYTES);
      }
      if (pow)
         FreeMem(pow, (ULONG) POW_LENGTH);
      if (scream)
         FreeMem(scream, (ULONG) SCREAM_LENGTH);
      if (win)
      {
         while(msg = (struct IntuiMessage *) GetMsg(win -> UserPort))
            ReplyMsg(msg);
         CloseWindow(win);
      }
      if (font)
         CloseFont(font);
      if (GfxBase)
         CloseLibrary(GfxBase);
      if (IntuitionBase)
         CloseLibrary(IntuitionBase);
      Exit((LONG) code);
}

/*
**    shut_down_audio()
**          Cleans up after using audio.device.
*/

void shut_down_audio(scream, channels_used)
struct IOAudio *scream;
UBYTE channels_used;
{
      scream -> ioa_Request.io_Unit = (struct Unit *) channels_used;
      CloseDevice(scream);
      DeletePort(scream -> ioa_Request.io_Message.mn_ReplyPort);
      /* remember, pow and scream shared the same reply port */
}


/*
**    init_audio()
**          Opens audio device and allocates a stereo pair of channels.
**       Returns a mask of channels allocated, or 0 if error.
*/
UBYTE init_audio(iob)
struct IOAudio *iob;
{
   UBYTE channel_map[4];
   LONG error;
   ULONG mask;

      channel_map[0] = 0x03;     /* channels 0 and 1 */
      channel_map[1] = 0x05;     /* channels 0 and 2 */
      channel_map[2] = 0x0a;     /* channels 3 and 1 */
      channel_map[3] = 0x0c;     /* channels 3 and 2 */

      /* Get a reply port so the audio device can communicate with us */

      if ((iob -> ioa_Request.io_Message.mn_ReplyPort
                                        = CreatePort("ac", 0L)) == NULL)
         return (0);

/* We are now going to be pigs and set our priority to the max.  If
*  successful, we hold exclusive access to our stereo pair of channels.
*  Why don't we just set our priority lower, allocate channels, and then
*  lock them?  Because we don't intend to give up our access until
*  we quit.
*/
      iob -> ioa_Request.io_Message.mn_Node.ln_Pri = ADALLOC_MAXPREC;
      iob -> ioa_Data = &channel_map[0];
      iob -> ioa_Length = 4L;

      error = OpenDevice(AUDIONAME, 0L, iob, 0L);
      if (error == 0)
      {
         mask = (ULONG) iob -> ioa_Request.io_Unit;
         return ((UBYTE) mask);
      }
      else
      {
         DeletePort(iob -> ioa_Request.io_Message.mn_ReplyPort);
         return (0);
      }
}

/*
**    init_sounds()
**          Initializes our IOAudio request blocks for sounding
**    once.  Attaches waveform data.
*/

void init_sounds(scream, pow, channel_mask, scream_data, pow_data)
struct IOAudio *scream, *pow;
UBYTE channel_mask;
UBYTE *scream_data, *pow_data;
{

      scream -> ioa_Request.io_Unit = (struct Unit *)
                                      ((ULONG) channel_mask & MAPRIGHT);
      scream -> ioa_Request.io_Command = CMD_WRITE;
      scream -> ioa_Request.io_Flags = IOF_QUICK | ADIOF_PERVOL;
      scream -> ioa_Data = scream_data;
      scream -> ioa_Cycles = 1;
      scream -> ioa_Period = SCREAM_PERIOD;
      scream -> ioa_Length = (ULONG) SCREAM_LENGTH;
      scream -> ioa_Volume = 64;

      /* copy keys, ports, and above stuff */
      *pow = *scream;

      /* Now, more specifically... */
      pow -> ioa_Request.io_Unit = (struct Unit *)
                                   ((ULONG) channel_mask & MAPLEFT);
      pow -> ioa_Data = pow_data;
      pow -> ioa_Period = POW_PERIOD;
      pow -> ioa_Length = (ULONG) POW_LENGTH;
}

/*
**       read_data()
**             Read in digitized sound files, placing them into
**    Chip memory.  Note that the files are IFF, but treated as
**    raw data.  Hopefully, won't be able to hear the 'pop' as the
**    header information is played.  NOTE:  Would be simple
**    to skip over the header.  A job for a future revision.
**    Call AmigaDos directly, bypassing all that "ffunction" stuff.
**    shut_down() is responsible for freeing up the allocated Chip
**    memory, so don't have to worry€€€€€£7` ª€€€«ÿ €¿w`Ô€€€—ÿcfx €€€—á3x8 À€€€€€€‡/v8?lPÀ•ÿÄ€€€÷8è—ë'`ep< €€€€€€€@Ä”€€€ƒ×#Ç?$Èï: €€‡+ã£÷?@à€€€€€“p à€€€‡ïW@à€€€€¿` à   òw0Ä«çÒ÷wx  À€€×À€«È€€Ó?xð€·Õû#[{wh À€€€€€€€¦ï/ €0Ð€€ƒÛWPÔ°€€€€€€×+p €€‡ç?{` €€€€¿'l4ä €€€€€€€·ÿ?s`S €€øÀ€¯?T4°çÐ€€€€§W €—ÿO<ð€€€€€·`ð?R €€€€ƒçg|(Ð€€€€€Ë÷3P €€€€€ÿo`$À€€©€€Ó+P €€€€«Pè€€€€‡ç_v@  €€€€€€€ß/PÔ6áñÐ€€”ß'pkP  €€€€€×'8 Ð€€€€€€ÿ(7EPh0áG# è¦ €€€€€€€ÇSt2à€€€€€Ï_@ðàÐ°±°“€¡ç!Oô7 }T ¨€€€€—?p02P5?d9 ¨€€€€€Óg €€€‡ÿ`ð€÷w€û/pR` °€€€€€‹ã?p €€€ÆÈÖùÈ·w` €€§€·?` €€€¯wP æ° ¥×?wp€€€§ÿ ðçc`öÐÁó? À€€Ç'o`0ð°€€€€€£÷7w@Ð€€€€‡ço@ð€€€€€€€×#` €€€ß?d$è €€€€€¨ï/c8Ð€€€€¿g`0 €€€€€—ÿ ?8ø°€€€€Ä•á?~0 €€‡'hè€€ß÷cpÐ€ß?P €€€€€€¿+h€€€€×P °€€€£ï?t2 À€€€€€€«ó+U` Ð€€€€€€ãàÓ?4à€€€€ÿWP¢€€€€“ã[@°·%GwB´€€€€€·õ-ot0À€€€€“'PÀ€ÿ`àÛ_ Óà€€—âë'?crpPÐ€€€€€€¯0°€€ÿ`tà€£þ/s` €€€€§÷Wx0ä€€€€€€¯?` €€€ßW|0À€€‡·íS`(" Ð€€³í#gEh Ø€€€€€€¯?@ð €€€¯ÿwx0ð¢€€€€€€‹ã Kt Ð€€€€€ƒ3g@ë'oPà €€€€€€€Ï!@Ð€€€€€ï+o{hÒ‘ÿ €¿O8ð²€€€ƒë_P°€€€€¯?4Ä€€€€·`P°€€€€€€³ûOP?pv0Ð€€€€€‡×74Ð€€€€ç'sp(ð„€€€J*'3;cj~4à€€€€ÑK0À€€€€‡Ðã/`€€€€€ ç?ggpq@È€€€€ÿT ¶“Óà°ÿ7w`  €€€€€·ó7pDðŠ§€€€€€€Óã'wp$à€€€‡?4À€£ÿðÿgpð€€§5ÿSx °€€€€¯?8ð?0àæ €€€‚†§Ë;W8ð €€€€·?u|0Ð—×à‚€€€ß ;` €€‡ï#P  €€¿?Dà  €€ Ð€€—ÿjjv$à?P°€€€€€€Ÿd À€€€€—÷ GseHÀ€€€€÷ +~0À€€€€€—çoD °€€€€€€¡å#x0Ð€€€€€€€Çc|4Ð€€€€÷Kw` €€€¿3P`@00÷;`< À€€€×W`à€€€€€“×?@à€€€€€ç?o|0à€€€€€—op¢€€¥ÿc`0 €€€“×!ox8Ð€€€€€€¿?pux@ð €€€€€€€€ÆSr{` ä¨€€€€€€¿Wd ¨€€€€ÇgD €€€€£?6cqH?B €€€€€¡ç#gPÐ€€€×/P"ðïÈ€€€2O`s@ À€€€€€‡×oxà€€“Ãë'uP#c(À®€€€ƒÀ„€€€¯ÿoà“ÿgp À€€€€§{0°€‡wpà§ÑÐ€€ßx  €€£/t7<0ä €€€€Û?0o` €€€¯C4ð€€€€×?pT€€€€€·7` ²€€€€—ç3d  €€€€·ü?`  €€€€¿?~0ôÀ€€€€€€—àÿG0à €€€—ç?@Ð€€€€€³sPÀ€—×Ð² €€ç ?x4ô„€€€€·P°€€ï>2"ýÿS`PÄ€€€€€—íO@ð €€€€çW| À€€€€§<KBà€€€€€€ƒr`ð€€€€¯ÿ5P[<ðÀ€€€€€€¿o` ¡ë)sp€€€—ÿa €€€€ÿDÐ—¿Ò÷W='W  €€§'[@ø¤€€€¯WPà€€€³ÆÓ'6;p °€€× wt€€€€¿o@à‚€—×Ê Óÿ-WIkRP°€€€€€€ÿg8 €çkPð€€€¿ctW@à €€€§ÿ7kP(ä¡€€€€€€€¡ë'd0# Ð€€€€€€‡ïp'Pð°€€€‡÷p €€ÿ|@ðÈ¡¿à€¯?Pð€€€€×` ¤€€§ÿoDÀ€€€¿#Ku0 €—½ÿöÐª·÷>`ô €£€«ÿWT €€€€¯ ¶ÿWP€€¿ ?p à €€€€€€¿/|8ä€€€€—÷WPÀ€€ÿ"À€€€€ßW{r éõè €€€€€§~  €€€€×I?op÷ü€€¿  ÷°€€ï?<Ð€€€¯p °€€€€µ` €€€€†×ÿ_`°€€€€€€€ËD! Ò÷O` à €€€€€€ƒ€§+{|ð«ÀÇ2Ð‚€€ ÷;x €€¿ÿ_t( À€€€÷ »?PÀ€€Â”¦Ó/VTe`Ð€€€€€¿?P à€€€ßG@?TK` ä €€€€€Çÿ7Wwx °€€€€€ŸwE  €€€€€¿#H €€€€‡·+~ âÐÀÃ €€€€Ó'ra` €€€£/{hcPô £ï**;oP €€€€€¡º€€€õ?Pÿæ÷Wf ¤€§ÅØÓ?p ¨€€€€€«ÿwPP:ð¯¥§Ñà°€€€ëSVT5 ð#mt`@ À€€€€€€‹ñ_h è±£ÿgu}p0àÿgt(3 €€€€€§'`°”£°ç?PÄ‚€€€‡çWp À€€€€€€…×Op&à€€€€€€€Ï#b éÀ€€€€€ï` Ð€—ßk` €€€€Ï ÐÄ÷ ä€€×?` €€€€‡çw~8 ¿7r|PÐ„€€€€€€§÷?~ Ð€€ƒû/=5ðÓkqDäçä°€€€€§?>Q0À€€€€—ï_~0À€€€€Óo0¨„€€€³ÿ`??B(
þà€€€€€€€€—ÿWc â÷à€€·W Ä„†€¯?P7PÀ€€€€€€•ógw`R à„€€€€€×Spð€€€€€ÿ~ €€7ð€€DÔ€€€€€¿/2Ð€€€€ËW` À€€€€€€€§ë'kdP4âç7 À€€€€€ƒÿ<1(ð¸³èà‚€ç7FKw>à€€€€€§ÿ_0à€€€€·í+` ´€€€ƒÿS~4ðª€€€€€‡ÿs@À€€€‚ç7@à €€€³ÿ?0à€€¯?vHûàƒ€§ÿàÄ÷RU?Kfpi@ Â€€€€€€€ÿ@À€€€×? €€ÏO8À€€¯óUd¨«¨€ËwPÀ€€ãôÐ»Æ€€ÿ`$â€€€€€€ÇtwR(à€€€§/{P Ð„€×ò°„‡×?o`À€€€€€€€÷x €€€‡¶`à€€€€‡]@ð€ÓOHà€€€€€£÷k4À€€€¡Ç÷_`D €€¡ï3 Ô«Ðkp4 À€€£÷?0À€€€‡Óo8à€€€€€€¿?HA( à„€€€€€£÷? ¤€€€€·P?WP û?p0Ð€®¤€€§ ´€€·?` ð·3c@Ä€€€€€€£÷3` €€€€ƒßWdà€€€ÿJPox$À€€€—Éÿ`6cpð€€€á Gbà€€€¿WpÇ@ à€€€£°—ùS@Ð€€€€€¿{d À€€€€€£ßÿ#ÐË'ozcHA$Ð ³ª·ü+?k`ðÂëþà¢€€€“÷K4à€€€?=?`<ð´ ³åÿô €·0 €€ƒçox;,3 è×ÿ?Pà€€€€—ÿgpPQwHà±ãüçÈ„€€ƒâ÷W`0 àÇ÷
Ð €€·0´€€€€€§h Ð †‘ Ïb*à €€€€€€€»?@ð²€€€¯âÿ?` ²£ÿÐÐéÀ¡' ÐÅ÷0 „€€·'gpð€€€€€€€·?DÐ€€€€€€€¿g`à€€€€¿?o~VP> à‚€€€€€ç_x °€€«ÿgp °‚€§?mR?;$#ÿÐ€€€€€€ó? ¨€€€Û/P ¡€€€‹'`à¨€§??YC 19?3 ´€€€ç% àÐ “ÿ?P À« €€ç?`à€€€€¡ÿwb* €€€€€€Ï#p€€€€ç?h µÓ'``H3 è¤€€€€ ß7g0à€€€€€€€«ígP €€€€€€Ï?$À€€€»#o@à€€€¿Sp¤€€€€Û?@ÿÀ€€€€€€—óO 
À€£ÿ?(3À€€€¯gd Ð€€€€€—ëWt ƒ·ÿ/0Ð€€€€“p  €€€©Óÿ?a= ¡¿÷üòÀ€‡û  #ÆßWsp Ê€€€€Ÿ7wsf[P,#P` ¸µçð÷à €€€¿/s`G 7`^`Ð€€€€ãÄ€€€×?u@À€€€€ÿZE°†ƒ €³WPðº·Óã´€€€€§ÿW`GUox:ô €€€€€€Ì?Pè«·ß!H þ ðˆ€€€‡ÿOPð €€€€—ÿxð€/pP;`v`> Ð…€€€­§ €×O{z0+tGa>ð€€€€€€€Ë
 Èª·ó+e8(Ð€€€€€€Ï?Døàý7? Ð¨€€€¥€§÷7p À€€€€€€¿_Pà ƒ€€€€ç?@'7cu`0ôÐ¿É°·kx “ÿ/KXUciTa à€€¿÷À€ÿRbg6Ð€€€€€€€×? ¢ç*àÑñÔ÷/0:C3$ è¹½´„€€€¯~ À€€€€€€Ó7X Ð €€÷_p  à¿å ò  Ð€“ÿ;p  €€€€€ƒÿO@à€€€€€ÿ8À€€·3K`w`à÷Ð€€€€€·#@&è´€€€¯'kx €€€€«ÿg  €³ÑÉàÒÕ` À€€¯+We`@À€€€€€Ó7s`  ?4àÁãÿ ÐË¶¶³±Ç'{Dø €€‡Ûk`ô/8  €“~d@ ä¸·ØÖÊÐ×!w~  €€€€€©×o@à€€€;"ðáp °€€€€Ï_`5co`tw`(/gp€€€€€€€€ƒÿox@G0ð €•ë 7D< !SP €¯" /E4 7047*.  + ÷ôÐçû Ð²£+0ü÷àÊ×Á£‚ˆãU@êÀ ×w<?p@'c`ä«ÿ á ‡  €€€€‡0Ð€€€€€¯7`ð° “€€€ÿp €€€€€¿gp"À‡ £ €€€€×'W`P À€€€€£'@À€€€€—/cFk8à€€€¦ã'?ó÷Ð€€¿W8à€€€çg@à—«¥ˆ§0à€€€€çWpÐ°­ €€¯ÿ?Pð€€€€€€×W` €€€€Ó   ', G` À€€€€§g8 À€€€€·ÿ?~0à€€€€€€€¿@ð€€€€€§÷Wt €€£Ç« £Óõ7`°€€€€€ƒ»Ð÷7  €€€§¸Ï' Ä×øÀ“€€€Ç?~4Ð€€€€€Ÿ÷W€€Ý?GgPà€€€€Ÿá#`Là€€€€¿& +? Ô ƒ‘ÆÔ°×'` €€—í'awh à€€€€€€£÷W0 €€€ï  	ôÕÒÛû!7W~b8  ¿/P €€ƒÿ ðêÀ€€Û'wp7(
òÀ€€€§w` €€€—ÿ °€€€€ƒÛ/0°€€—ÿ(à€€€€€«ç!GPà€€€‡÷?sPä€€€€€®ó+O` €€€€§ÅÿSRYwoBÐ¿ç (  Õ°»ÿw@À€€€€—swd4 ãÃ©£“Û7s0ðÀ€€€—ÿa`èêäÓëÐ€€ÿPð¨†’»õ'"	À€‡ï1wHô €€€€€€€Ç0ä €€€€³ÿ?p0à€€€€“×'p €€¡ß/W:	ôÀ€€Š »ç'$ð—ÿo0à€‹/@ä¤€€€Çg< çÿù°€€€€€¯ÿ44  àÑò!)
 äoP  €€€€€¿Wp Ä€€€€ßW`  €€€€€€¿wh €€€£û?cp Ð¡×ûû?R ÀË!$ àÅ³Ç à¢€€·Wy`?cP à €« €€Ë~ € ª€€“7`4 ä€€€—û, à»ÿ?gtT ôóàÉâÖ €€€’®ÿPà€€€€·þð¦ÛO0ô €€€€€¿?{p ²€€€€€§±Û;~P'3?cd$Ð  €€€¿ï,%'Op €€€€¿?8âÃçðÔÐñ÷ÐÇk`Â¨½ÿWkaHEH: ðÀ€€€±ÿct(Ô€€€€€›÷o@à€€¡i` À€€€€€ƒÍ/pÐ€€ÅKp €€€€ç+P_~ ÿ;WwPÄ€€€€€€€·0 äÐ×ãÔ·ÏûöÐÄ €€€¿@"ð»á7?Gwt0ä²€€ƒçWx °€€€€€€€€ƒáþ_p0è €€€€€€·èÿ#)$(R{w`o` €€€€€€ ¿?f €€ß?x$Ð€€€€€€³ì#h ÒçÐ€€€€ß_R àÅÕÿ+ ¨€€€€¯7{8è €€€€€€£û?4úÀ€€€€€€€·ÿ?4à€€€€€€€×?x$à¤ §ã0 Ðÿ?Pð €€€€ Ê÷%Ja`À€€€€€€ïwdKwp ´„‚ƒ€€ˆ¡çOwP üàÀ«Óðâ €€ÿ3<?\8ô €€€‘ÿpdT0à ‚€€€‡ ×!o  €€€€§( 	 /;?( ÙÇÑáèûêçÿ à¤€€€€Ï/~ €€€ÿX0 À€€€—`7 Ð€€«ÔÚë øêÿ(W` üÀ€€€€÷_4à€€€€€·?8à€€€€€÷_(÷ÿüú >0ô¤€€€€—ó+wP €€€€€€ïHÊ¨¥ ¡Óú à€€ß#ehQ0â¸Ó'F0
èç 	 À€€¿+spBø €€€€Ÿë?0èÀ„€€€‡·ÿ3?cz<à§ ¤¢„€€€Û?@Ðï?{` à €€€€—»à?(òÂç%?>7gp Ð¨€€€‹÷WgkriP4+à €€€€€¿?@ä €€‡“Ç7q`°€€€€€Ÿÿwp °€€€€€€€Ÿw0Ð€€€×muP ÀÇ?k~0Ð€€€€€ß?( €‹¹ó?rD!ðÄ —ï!èÀÕ÷#0û ÷	1;?VC=?ðààçÿ÷äÑÿW4à€€€—ÁÐÐ°«ÁÜû?~@ä £Ûóà¸±Ì÷ùáÐ³×?@Ð€€€€€€·?`ÔÐ €€€€‡Ð¯Ó'?à«Çò?d ä€€€€€÷w`QT °€€€£û øÀ¤¿%7??4(
ÐÇÿ5QC6ðèàã#W4àÀ €‡`Ô×ð÷êÐµ €€€€€€»'P àck@à€€€€³ï3@Ð€€€€€¿_ztp ÇÁÉ €€€€€¿üOH ´€€€‡¿ÿ_p2ð€€€©Óc` ÓÂ€€€€€¯ÿ?x ÁÖ!HWPà€€€€€€€‡Çïox €€€€€€€Ó7| ´€€«Òÿ7"ðÔÀ×à°½ÿ"à “×3?]w{}g`"À“+ð«´çÿ7P1à€€€ƒ»÷1_Hð°€€€·E0
à°±ÿ|à· ô°»07??p$À€€€€€€×g` €€€€‡ÿcgu`à°€ÏòÀ€§_xÐ´€€€€€€—?0¢€€€€ÿ_~4à€€€´ÀªÓUwdçÐçõè÷ÿâÔó/??vcF0à°ÇÐ¥·ÿ%4+ ¨€€·ÄµÓ'P6è€€€ïSw> Àƒ„€£ã4sh$ çèÆ «'`Ô’€€·ç÷ =F ¤€€ç÷À€€¿6[0à·÷ðçW@à €€€pð€€€€·à€€€€‡Òè¨ßR` à·ÉÐØÇÿ'+S`$ðôà €€ÿ_p ¦€€€€Ÿ7`à€€€€ ¼Ä»Ü?sPÕW`$ ¨€€€°ó?`P3$ôÀ·÷$W !7À—õ ôÉÜ à°ºÑäíà×/:;WP?=Xp ðÙñÿ °‹ç*À‘—¤_pVj GD €€€€ƒÑ/PCs@æ°€€€—?~@ä€€€€€€€€€•ÿwt ð¤€€ƒçKapD?4¶•Çéû&w`:Kh` €€€€€ßxðSH €€€ ®°Óû+f €€€€€€Ï'*;@19FH? àñãë à€€€€€€ß`ð €€€‡ÿ~8 øðÐÉÒÃ§¨¦¶» €»C0?H Ð €€€ƒÀ€€§-bdÈ  ”¦ß0ðõ 0+?X[`qhÀ€€€€€€Çÿ 3?03 À€¡ï7a@À€€€€—÷õSd Ð€€€€€Ç!P[T@ çÐÿw4ë €€€€ç;*ØÕàÿOki`PH0?[o{@ðÕ²€€€€€€§/{h8ðµÊÀ§ ·÷!3~@ÿ"7 à€€‡h0Ð ¤·ûàÿG|rhPF àÂ² ‘ß-2 áÑó äòÿO`:ð×ÿèãð°†£w8à€€ÏôÄ¨”‡‘÷€€€€€€“§ã;4ðÌ €€€‡ç!w ´€€€€€€—/@ä ‚€€Ó7x0øÀ€€€¿?8+(0à €€€€€Ÿ;`: ýó3gp(à €€€€€×:? 'wP(àƒ€’ ¿ÿ?o|`M0)"øë$° Û4.%+- õûý  êÄ°§²ËÉÉ÷+?oG~  €€€€€”Ëÿ_~D?6 À„•§«€‡‰•«Ó[P<?;$ôÔ Š¢ ·ó+a`T``>(?>ùðª‚€—Ëÿ  ×ÿ#Oe<1"
+ô €€¢µÑå?~D°€€·´”‡€€€—÷'Wp0ðÀ¿û7md<ôÀ¥±ÆÉçþøàÇã?|ð €€€€€‚§ÐgpÀ·×À €€€‡?@ à©ï/??Gch À€€€€€çod  €€€€€“ç'WvhmX8   üû'?`@à €€€ûð —@ €€€€¼æÿðö/Hc`ÀÏ+kpT$à€ƒ¤³ã+<ðÀ€€¿?pà€€€€§÷#?w Ð€€€€§ê'wkUg|b`P à €€€€€€€ÿs °€€€€—ç'0Ð€€€€€Ÿÿ ' ü ?R>àá?jpsuU70 ôàÐ¦€€—Çæ19 þ':GgPñÖÐËó+  àÇà÷.Ge` À€€€€€€€—wpPGWP,ôÒ¨–“§ß 75" !7Wum`<ò÷üÔÐ'g`F+Ö®×0ð €€€£Â×7G``WP* Ä  ´Äá#gx4÷åã÷'K}hPSD²€€€€¯?P Ô¹·÷# òôàë3c`ä€€€€€€ïFà€€€€€€¿?p €€€€€€ÇWT(âÇÐåÿðÐ· –Ãö 3??(+$ø}PÐ€€€€€³'4ôÐÂÒãÀ€€€€Ó'Wm`H8$ °—’§ÿOjF  èÐçû+#  7`VPD*üâÐÀÇÿ( èÁ£³çøàÑ÷?wp0è€€€ƒ»ó-Sa@'[|$À€€€€€€±ç?qR$úæÖÆÀ« “¡»ÿSyp4ðÄ°·Ö3Wpjd`äÌÓÈ¢£Ý &*8E= ýðàÀ¦¥°´¡“ƒ›×ÿ	  âÐÂÅõ?{sapjdD ð°¢ §ÏWp`@ÐŠ€€€ñ
 çÀ”€€„«ç'cP4$ À Ãë ðð_`H2à°‘€€€ã/wDÒñ$''?ph8üÈ©­×ÿ;:èàêÿ5?  1)0'7G`gp`0, øÒÀ²§¸×Ð€€€±àò_~`?ðâ°€€ × ?st$ÀÓ?OP: °…¡³Û,76?p0üõûýð°€€€€÷4 À€€€€€ƒÿ?h$ø %S~` Ð€€€€€ƒï úîðÕïO~Päæÿ
?(À€€€€'`: æ°€€¡Êó '*):EJ0ôààÿ'6?K(øÀ±ª€€«û. èÐÈÓæçÿ?QVSNPYhR0ä»ÿ?s~PæÐ³ €€€€€§/` À€€€€Íÿ õ3a|P ¤€€€€€ï_Pð’€·à÷" ðÐ´¦pà€€€€€ï?bTM0ð°€—÷?qx@  à´ ·     •                                   10
                 9 ----------------------+                      9
                 8                       |                      8
                 7                       +--------------------> 7
                 6                   +------------------------> 6
                 5                   |                          5
                 4 ------------------+                          4
                 3 ----------------------------+                3
                 2                             +--------------> 2
                 1 ------------------------+                    1
                 0                         +------------------> 0




      4.2.23  Rotation nach links


      ROTATE   in,bits,out[,init]


      in             Eingangsleitung
      bits           Anzahl der zu verschiebenden Bits (Konstante)
      out            Ausgangsleitung
 