home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / hp48 / 6588 < prev    next >
Encoding:
Text File  |  1992-12-31  |  3.7 KB  |  164 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!news.iastate.edu!vincent1.iastate.edu!sourada
  3. From: sourada@iastate.edu (Steven D Ourada)
  4. Subject: Tricorder simulator
  5. Message-ID: <sourada.725796573@vincent1.iastate.edu>
  6. Sender: news@news.iastate.edu (USENET News System)
  7. Organization: Iowa State University, Ames IA
  8. Date: Thu, 31 Dec 1992 10:09:33 GMT
  9. Lines: 153
  10.  
  11.  
  12. In this message:
  13.  Tricordr documentation
  14.  uuencoded tricordr executable
  15.  Tricordr assembly source
  16.  Tricordr user RPL source
  17.  
  18.  
  19. ---------------- Cut here. Tricordr documentation follows. ----------------
  20.  
  21.  
  22.                Copyright 1992 Steven Ourada   Freeware
  23.  
  24.                               TRICORDR
  25.                               ========
  26.  
  27. What it is
  28. ----------
  29.  
  30. This is a silly little program to simulate the 'Tricorder' devices used on
  31. Star Trek.
  32.  
  33.  
  34. How to use it
  35. -------------
  36.  
  37. To use TRICORDR, download it into a convenient directory, take off the 
  38. plastic cover over the infra-red pair on your 48, and execute TRICORDR.
  39. When you bring the front of the 48 close to some object, the speaker will 
  40. repeatedly beep. Wow, lot's of fun, eh?
  41.  
  42. When the excitement dulls, press a key to get out of the program.
  43.  
  44.  
  45. How it works
  46. ------------
  47.  
  48. Nothing too complicated: a small assembly language code segment pulses the
  49. IR emitter, and checks the detector to see if there is a reflection. It reports
  50. this back to the user-RPL code that beeps if there was a reflection.
  51.  
  52. Don't be worried that this will drain your batteries; the IR LED is only on for
  53. about 20 microseconds for each 10 milliseconds.
  54.  
  55.  
  56. I disclaim it
  57. -------------
  58.  
  59. This is Freeware, copy it freely as long as you give credit where it's due.
  60. There is NO WARRANTY with this software as it is provided to you with no charge.
  61.  
  62.  
  63. That's it
  64. ---------
  65.  
  66. Keep in mind that this is my first attempt at using Saturn assembly and my
  67. first HP48 program to be posted to Usenet. :-) If you have any comments,
  68. please mail me. 
  69.  
  70. ----------------- Cut here. uuencoded executable follows. --------------
  71.  
  72. begin 644 tricordr
  73. M2%!(4#0X+46=+>!A(RPJ<   ,,,PPMP"BP" OWD&\1H!$+6 @ 11";$< 1"E
  74. M@( UZH: .%$(40M1# AX !$/ P Q9PT0'P, ,0>&+WT&<$$3$W$9U/C29Q D
  75. M882 /.PBA_O!H@(' ! 3=A[Z+M+9 C,I(        " PDP*8"0       \2E
  76. 7L1(#U2_2#B-SJ)%K(]C[@;T?.3:R$@,I
  77.  
  78. end
  79.  
  80. --------------- Cut here. Assembly source follows. ------------------
  81. ; Copyright 1992 Steven Ourada    Freeware
  82.  
  83. ; Embedded assembly code to do "proximity check"
  84. ; Turn the IR on, check to see if it reflected, turn it off
  85.  
  86.  include class.mac
  87.  
  88.  rpl $02dcc              ; DOCODE
  89.  
  90. pgmbeg
  91.  rpl pgmend-pgmbeg       ; length of code 
  92.  
  93.  jsr save_regs
  94.  
  95.  move.a #$11a,d1
  96.  move.1 (d1),a
  97.  bclr #0,a
  98.  move.1 a,(d1)          ; clear IR detector bit
  99.  
  100.  move.a #$11c,d0
  101.  move.1 (d0),a
  102.  bset #3,a
  103.  move.b a,c
  104.  bclr #3,c
  105.  move.1 a,(d0)          ; turn IR emitter on
  106.  
  107.  move.1 (d1),a          ; read IR detector
  108.  move.1 c,(d0)          ; turn IR emitter off (it's only on for ~20us)
  109.  
  110.  bbs #0,a,reflec
  111.  
  112. noreflec
  113.  move.a #"0",d1        ; return a "0" in the string
  114.  exg.a d1,c
  115.  bra.3 stostat
  116.  
  117. reflec
  118.  move.a #"1",d1      ; return a "1" in the string
  119.  exg.a d1,c
  120.  
  121. stostat
  122.  push 
  123.  jsr restore_regs
  124.  pop
  125.  
  126.  move.a (d1),a         ; assuming a string on the top of the stack
  127.  move.a a,d1
  128.  add.a #$a,d1
  129.  move.b c,(d1)
  130.  
  131. exit
  132.  jsr restore_regs
  133.  move.a (d0),a
  134.  add.a #5,d0
  135.  jmp (a)
  136.  
  137. pgmend
  138.  rpl $0312b              ; SEMI
  139.  
  140.  include class.sym
  141.  
  142.  
  143. -------------------- Cut here. User RPL source follows. ---------------
  144. @ Copyright 1992 Steven Ourada    Freeware
  145.  
  146. @ 'Tricorder' simulator
  147. @ Note that the assembly code must be inserted where shown for this program
  148. @  to work properly.
  149.  
  150. \<< 
  151.  "0"
  152.  DO
  153.   @  Assembly code inserted here
  154.   IF DUP "1" SAME THEN
  155.    200 .03 BEEP
  156.   END
  157.  UNTIL KEY
  158.  END
  159.  DROP DROP
  160. \>>
  161. -- 
  162. -------
  163. Steven Ourada -- sourada@iastate.edu
  164.