home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp48
- Path: sparky!uunet!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!news.iastate.edu!vincent1.iastate.edu!sourada
- From: sourada@iastate.edu (Steven D Ourada)
- Subject: Tricorder simulator
- Message-ID: <sourada.725796573@vincent1.iastate.edu>
- Sender: news@news.iastate.edu (USENET News System)
- Organization: Iowa State University, Ames IA
- Date: Thu, 31 Dec 1992 10:09:33 GMT
- Lines: 153
-
-
- In this message:
- Tricordr documentation
- uuencoded tricordr executable
- Tricordr assembly source
- Tricordr user RPL source
-
-
- ---------------- Cut here. Tricordr documentation follows. ----------------
-
-
- Copyright 1992 Steven Ourada Freeware
-
- TRICORDR
- ========
-
- What it is
- ----------
-
- This is a silly little program to simulate the 'Tricorder' devices used on
- Star Trek.
-
-
- How to use it
- -------------
-
- To use TRICORDR, download it into a convenient directory, take off the
- plastic cover over the infra-red pair on your 48, and execute TRICORDR.
- When you bring the front of the 48 close to some object, the speaker will
- repeatedly beep. Wow, lot's of fun, eh?
-
- When the excitement dulls, press a key to get out of the program.
-
-
- How it works
- ------------
-
- Nothing too complicated: a small assembly language code segment pulses the
- IR emitter, and checks the detector to see if there is a reflection. It reports
- this back to the user-RPL code that beeps if there was a reflection.
-
- Don't be worried that this will drain your batteries; the IR LED is only on for
- about 20 microseconds for each 10 milliseconds.
-
-
- I disclaim it
- -------------
-
- This is Freeware, copy it freely as long as you give credit where it's due.
- There is NO WARRANTY with this software as it is provided to you with no charge.
-
-
- That's it
- ---------
-
- Keep in mind that this is my first attempt at using Saturn assembly and my
- first HP48 program to be posted to Usenet. :-) If you have any comments,
- please mail me.
-
- ----------------- Cut here. uuencoded executable follows. --------------
-
- begin 644 tricordr
- M2%!(4#0X+46=+>!A(RPJ< ,,,PPMP"BP" OWD&\1H!$+6 @ 11";$< 1"E
- M@( UZH: .%$(40M1# AX !$/ P Q9PT0'P, ,0>&+WT&<$$3$W$9U/C29Q D
- M882 /.PBA_O!H@(' ! 3=A[Z+M+9 C,I( " PDP*8"0 \2E
- 7L1(#U2_2#B-SJ)%K(]C[@;T?.3:R$@,I
-
- end
-
- --------------- Cut here. Assembly source follows. ------------------
- ; Copyright 1992 Steven Ourada Freeware
-
- ; Embedded assembly code to do "proximity check"
- ; Turn the IR on, check to see if it reflected, turn it off
-
- include class.mac
-
- rpl $02dcc ; DOCODE
-
- pgmbeg
- rpl pgmend-pgmbeg ; length of code
-
- jsr save_regs
-
- move.a #$11a,d1
- move.1 (d1),a
- bclr #0,a
- move.1 a,(d1) ; clear IR detector bit
-
- move.a #$11c,d0
- move.1 (d0),a
- bset #3,a
- move.b a,c
- bclr #3,c
- move.1 a,(d0) ; turn IR emitter on
-
- move.1 (d1),a ; read IR detector
- move.1 c,(d0) ; turn IR emitter off (it's only on for ~20us)
-
- bbs #0,a,reflec
-
- noreflec
- move.a #"0",d1 ; return a "0" in the string
- exg.a d1,c
- bra.3 stostat
-
- reflec
- move.a #"1",d1 ; return a "1" in the string
- exg.a d1,c
-
- stostat
- push
- jsr restore_regs
- pop
-
- move.a (d1),a ; assuming a string on the top of the stack
- move.a a,d1
- add.a #$a,d1
- move.b c,(d1)
-
- exit
- jsr restore_regs
- move.a (d0),a
- add.a #5,d0
- jmp (a)
-
- pgmend
- rpl $0312b ; SEMI
-
- include class.sym
-
-
- -------------------- Cut here. User RPL source follows. ---------------
- @ Copyright 1992 Steven Ourada Freeware
-
- @ 'Tricorder' simulator
- @ Note that the assembly code must be inserted where shown for this program
- @ to work properly.
-
- \<<
- "0"
- DO
- @ Assembly code inserted here
- IF DUP "1" SAME THEN
- 200 .03 BEEP
- END
- UNTIL KEY
- END
- DROP DROP
- \>>
- --
- -------
- Steven Ourada -- sourada@iastate.edu
-