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 >
Wrap
Text File
|
1999-10-27
|
1KB
|
64 lines
#
# tilt_asm.S - (c) 1999 Till Harbaum
#
# tilt sensor driver for old style palm tilt sensor
#
# t.harbaum@tu-bs.de
#
.globl getvals
.text
.even
getvals:
link.w %a6,#0
movem.l %d0-%d5/%a1,-(%a7)
move.l 8(%a6),%a0
move.l #0xfffff421, %a1 | Port E data reg
move #2000,%d0 | init div counter
move %d0,%d1
move %d1,%d2
move %d2,%d3
move %d3,%d4
move %d4,%d5
loop_0: btst.b #6,(%a1) | wait while x high
dbeq %d0,loop_0
loop_1: btst.b #6,(%a1) | wait while x low
dbne %d1,loop_1
| this is time Ta
loop_2: btst.b #6,(%a1) | wait while x high
dbeq %d2,loop_2
| this is time Tb
loop_3: btst.b #5,(%a1) | wait while y high
dbeq %d3,loop_3
loop_4: btst.b #5,(%a1) | wait while y low
dbne %d4,loop_4
| this is time Tc
loop_5: btst.b #5,(%a1) | wait while y high
dbeq %d5,loop_5
| this is time Td
move.w %d0,(%a0)+
move.w %d1,(%a0)+
move.w %d2,(%a0)+
move.w %d3,(%a0)+
move.w %d4,(%a0)+
move.w %d5,(%a0)+
movem.l (%a7)+,%d0-%d5/%a1
unlk %a6
rts