home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / commercialdemos / warpup-warpos2 / warprace / modsrc / contextswitch / callppc.s < prev    next >
Text File  |  1997-09-24  |  3KB  |  98 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.                 incdir  powerasm:source/powerpc_lib/warprace/
  4.  
  5. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  6. **           All Rights Reserved
  7.  
  8.                 include intuition/intuition.i
  9.                 include powerpc/powerpc.i
  10.                 include warprace.i
  11.  
  12.                 include exec_lib.i
  13.                 include intuition_lib.i
  14.                 include graphics_lib.i
  15.                 include powerpc_lib.i
  16.  
  17.                 xref    EmptyPPC
  18.                 xref    _LinkerDB
  19.  
  20.  
  21. VERSION         =       1
  22. REVISION        =       0
  23. REVISIONCOUNT   =       1
  24.  
  25. LOOPCOUNT       =       1000
  26.  
  27.                 mc68020
  28.  
  29.                 section "",code
  30. start
  31.                 movem.l d1-a6,-(sp)
  32.                 lea     _LinkerDB,a4
  33.                 cmp.l   #WR_ID,d0
  34.                 bne.b   .leave
  35.                 tst     WRI_68K(a0)
  36.                 beq.b   .go
  37. .leave
  38.                 movem.l (sp)+,d1-a6
  39.                 moveq   #0,d0
  40.                 rts
  41. .go
  42.                 move.l  a0,a2
  43.                 move.l  WRI_POWERPCBASE(a2),_PowerPCBase
  44.                 move.l  $4.w,_SysBase
  45.                 move.l  WRI_STARTTIMER_68K(a2),a1
  46.                 jsr     (a1)
  47.                 move    #LOOPCOUNT-1,d7
  48. .loop
  49.                 RUNPOWERPC      EmptyPPC
  50.                 dbra    d7,.loop
  51.                 move.l  WRI_STOPTIMER_68K(a2),a1
  52.                 jsr     (a1)
  53.                 divu.l  #LOOPCOUNT,d0
  54.                 move.l  d0,Result
  55.                 divul.l #1000,d1:d0
  56.                 move.l  d0,ResultParams
  57.                 move.l  d1,ResultParams+4
  58.                 move.l  #STATUS_SUCCESS,Status
  59.                 move.l  #WRO,d0
  60.                 movem.l (sp)+,d1-a6
  61.                 rts
  62.  
  63.  
  64.                 section "",data
  65. WRO
  66.                 dc.l    ModName
  67.                 dc.l    Short
  68.                 dc.l    Description
  69.                 dc.l    Author
  70.                 dc.l    VERSION
  71.                 dc.l    REVISION
  72.                 dc.l    REVISIONCOUNT
  73.                 dc.l    0
  74. Result
  75.                 dc.l    0
  76.                 dc.l    RES_MICROSECS
  77.                 dc.l    ResultString
  78.                 dc.l    ResultParams
  79. Status
  80.                 dc.l    0
  81. ErrStr
  82.                 dc.l    0
  83.                 dc.l    0
  84.                 dc.l    0
  85.  
  86. ModName         dc.b    "CallPPC",0
  87. Short           dc.b    "CPU context switch test program",0
  88. Description     dc.b    "This program measures the performance of the CPU context\n"
  89.                 dc.b    "switches. An empty PPC function is called many times from\n"
  90.                 dc.b    "68K side and the average overhead time is evaluated",0
  91. Author          dc.b    "Sam Jordan",0
  92. ResultString    dc.b    "Average overhead time: %ld.%03ld ms",0
  93.  
  94.                 section "",bss
  95. _SysBase        ds.l    1
  96. _PowerPCBase    ds.l    1
  97. ResultParams    ds.l    2
  98.