home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / stepcounter-1.3.tar.gz / stepcounter-1.3.tar / stepcounter-1.3 / tilt_p3 / tilt_asm.S < prev    next >
Text File  |  1999-10-27  |  1KB  |  64 lines

  1. #   tilt_asm.S  -  (c) 1999 Till Harbaum
  2. #
  3. #   tilt sensor driver for old style palm tilt sensor
  4. #
  5. #   t.harbaum@tu-bs.de
  6. #
  7.     
  8.     .globl getvals
  9.  
  10.     .text
  11.     .even
  12.  
  13. getvals:
  14.         link.w    %a6,#0
  15.     movem.l   %d0-%d5/%a1,-(%a7)
  16.     
  17.         move.l    8(%a6),%a0
  18.     move.l      #0xfffff421, %a1  | Port E data reg
  19.  
  20.     move      #2000,%d0  | init div counter
  21.     move      %d0,%d1
  22.     move      %d1,%d2
  23.     move      %d2,%d3
  24.     move      %d3,%d4
  25.     move      %d4,%d5
  26.         
  27. loop_0:    btst.b    #6,(%a1)    | wait while x high
  28.     dbeq      %d0,loop_0
  29.  
  30. loop_1:    btst.b    #6,(%a1)    | wait while x low
  31.     dbne      %d1,loop_1
  32.  
  33.     | this is time Ta
  34.     
  35. loop_2:    btst.b    #6,(%a1)    | wait while x high
  36.     dbeq      %d2,loop_2
  37.  
  38.     | this is time Tb
  39.  
  40. loop_3:    btst.b    #5,(%a1)    | wait while y high
  41.     dbeq      %d3,loop_3
  42.         
  43. loop_4:    btst.b    #5,(%a1)    | wait while y low
  44.     dbne      %d4,loop_4
  45.  
  46.     | this is time Tc
  47.     
  48. loop_5:    btst.b    #5,(%a1)    | wait while y high
  49.     dbeq      %d5,loop_5
  50.  
  51.     | this is time Td
  52.  
  53.     move.w    %d0,(%a0)+
  54.     move.w    %d1,(%a0)+
  55.     move.w    %d2,(%a0)+
  56.     move.w    %d3,(%a0)+
  57.     move.w    %d4,(%a0)+
  58.     move.w    %d5,(%a0)+
  59.                         
  60.     movem.l   (%a7)+,%d0-%d5/%a1
  61.     unlk      %a6
  62.     rts
  63.