home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / gcc_9112.lzh / include20 / inline / battclock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  1.1 KB  |  54 lines

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct BattClockBase * BattClockBase;
  4. #endif
  5. #ifndef BASE_PAR_DECL
  6. #define BASE_PAR_DECL
  7. #define BASE_PAR_DECL0 void
  8. #endif
  9. #ifndef BASE_NAME
  10. #define BASE_NAME BattClockBase
  11. #endif
  12. __inline static void ResetBattClock(BASE_PAR_DECL0)
  13. {
  14.     BASE_EXT_DECL
  15.     register void *a6 __asm ("a6");
  16.     a6 = BASE_NAME;
  17.     __asm volatile ("
  18.     jsr a6@(-0x6)"
  19.     : /* no output */
  20.     : "g" (a6)
  21.     : "d0", "d1", "a0", "a1");
  22. }
  23. __inline static ULONG ReadBattClock(BASE_PAR_DECL0)
  24. {
  25.     BASE_EXT_DECL
  26.     register ULONG res __asm("d0");
  27.     register void *a6 __asm ("a6");
  28.     a6 = BASE_NAME;
  29.     __asm volatile ("
  30.     jsr a6@(-0xc)"
  31.     : "=g" (res)
  32.     : "g" (a6)
  33.     : "d0", "d1", "a0", "a1");
  34.     return res;
  35. }
  36. __inline static void WriteBattClock(BASE_PAR_DECL long unsigned int time)
  37. {
  38.     BASE_EXT_DECL
  39.     register void *a6 __asm ("a6");
  40.     register long unsigned int d0 __asm("d0");
  41.  
  42.     a6 = BASE_NAME;
  43.     d0 = time;
  44.     __asm volatile ("
  45.     jsr a6@(-0x12)"
  46.     : /* no output */
  47.     : "g" (a6), "g" (d0)
  48.     : "d0", "d1", "a0", "a1");
  49. }
  50. #undef BASE_EXT_DECL
  51. #undef BASE_PAR_DECL
  52. #undef BASE_PAR_DECL0
  53. #undef BASE_NAME
  54.