Pl2 EXOS 4.DOC

From Atari Wiki
Jump to navigation Jump to search

                          ------------------------
                             EXERCISES on

                              programs under

                                INTERRUPTION

                           -----------------------


1) Exercise no.1:
   --------------
  a) If TACR is %100 and the data register is 42, what will be
     the calling frequency of a program on this TIMER?
     Will the program be installed on TIMER A or TIMER B?
   
  b) How to stop an interrupt-driven program installed
     under TIMER A? (In 1 line!) 

  c) We want to install an interrupt-driven program that should execute
     approximately 245 times per second, give a possible value of the control
     and data registers to achieve this effect.

  d) Can we install multiple interrupt-driven programs in the
     same TIMER?
     (A bit of common sense is enough to find the answer...)

  e) An interrupt-driven program must necessarily execute in
     SUPERVISOR MODE.
     Find a reason for this ... (Very simple)


1) Exercise no.2:
   -------------- 
  Since the operations of installing a routine on TIMER A or
  on TIMER B are quite repetitive, you are going to create two MACRO
  INSTRUCTIONS (TIMERA and TIMERB) which will take care of installing a
  program respectively on TIMER A and TIMER B.

  Indications:
  ------------
  .Use the masking operations AND.B  #BBB,$address and 
   BCLR #BBB,$address to modify the values of the different
   MFP registers.
  .Use the XBTIMER function of the XBIOS to 
   simplify your work...  


2) Exercise no.3:
   --------------
   Create 2 MACRO INSTRUCTIONS: STOPTIMEA and STOPTIMEB which must 
   respectively stop TIMER A and TIMER B.
   

3) Exercise no.3:
   --------------
   Create a program that, after being loaded, returns to the DESKTOP
   and changes the color palette at regular intervals.

   Indications:
   ------------
   .As you can guess, this program will be an interrupt-driven program!
   .Use your TIMERA and TIMERB macros to install the program.
   .Attention! to return to the DESKTOP, do not use
    the PTERM function of gemdos (Macro 'TERM'), but the function of
    code $31 of gemdos: KEEP PROCESS (Macro 'KEEP') so that the prg
    under interruption is not erased!
   .For the change of the palette, use the system variable
    'colorptr' as the GEMDOS function uses SP...
   

4) Exercise no.4:
   --------------
   Create a program whose main part runs in a loop and
   displays (Macro HEXA) the value of an L-M from the BSS segment and another
   part, an interrupt-driven routine, increments the L-M which is
   displayed by the main program.



                           --------------------
     

     
  PIECHOCKI Laurent
  8, Impasse Bellevue            Corrected in the file:CORRIG_4.DOC
  57980  TENTELING                                       ------------   


Back to ASM_Tutorial