Path: funic!news.funet.fi!sunic!hagbard!eru!bloom-beacon!snorkelwacker.mit.edu!usc!wuarchive!udel!rochester!uhura.cc.rochester.edu!ub!acsu.buffalo.edu From: cloos@acsu.buffalo.edu (James H. Cloos) Newsgroups: comp.sys.handhelds Subject: (HP48SX) TF, a toggle flag program Message-ID: <67797@eerie.acsu.Buffalo.EDU> Date: 29 Mar 91 02:20:23 GMT Sender: news@acsu.Buffalo.EDU Organization: State University of New York @ Buffalo Lines: 85 Nntp-Posting-Host: lictor.acsu.buffalo.edu Hello, Please find eclosed a usrlang and a rpl version of TF, a program that toggles a flag. The syntax is the same as for SF and CF. (There may actually be a routine in ROM that does this, but I haven't found one yet.) First, the usrlang version in ASCII mode: --------------------------------------------------START_HERE- %%HP: T(3)A(R)F(.); \<< DUP FS?C \<< DROP \>> \<< SF \>> IFTE \>> ---------------------------------------------------END_HERE-- Here is the RPLC version of the rpl version, using a minimal symbol table: --------------------------------------------------START_HERE- /* tf.rplc - by James H. Cloos, Jr. */ /* USE AT YOUR OWN RISK */ /* Note that RPLC format is free form wrt whitespace, just like C. */ // Also note that comments are as per C++. :: ==18ECEh #1 :: ==3188h ==1C4BFh ==61AD8h ==3244h ==1C28Dh ; ; ---------------------------------------------------END_HERE-- (The logic is basically the same; FS?C is used in preference to FC?C as FC?C at this level is basically a :: fs?c not ;.) The list file from star, cut to the essential section (ie, p2) is: STAR 1.04.4 Thu Mar 28 20:37:59 1991 tf.star - 2 1 70010 2 70010 ;; RPLC version A.1.3 3 70010 4 70010 d9d20 data.a type_col 5 70015 ece81 data.a x'18ece ;; Switch1 6 7001a 9ff30 data.a x'3ff9 ;; #1 7 7001f d9d20 data.a type_col 8 70024 88130 data.a x'3188 ;; dup 9 70029 fb4c1 data.a x'1c4bf ;; fs?c_1real 10 7002e 8da16 data.a x'61ad8 ;; *see below* 11 70033 44230 data.a x'3244 ;; drop 12 70038 d82c1 data.a x'1c28d ;; sf_1real 13 7003d b2130 data.a semi 14 70042 b2130 data.a semi 15 70047 (The names Switch1 thru sf_real added by hand.) Derek calls 61ad8: "if pop TOS = True, then do/skip else skip/do" As written, if a too_few_args or _bad_arg_type error is generated, you'll get the message "XLIB lll ccc Error:." I left this this way as it will eventually be part of a lib I'll be posting. When included in a lib, errors will show up as "TF Error:" instead. (BTW, a quick calculation suggestst that the XLIB number in the above error message would be "XLIB 1620 36" for the name 'TF' (it is a consequence of how lib's and dir's are stored internally; see my previous posting on the subject).) The ASC encoded version of the above is: -------------------------------------------------START_HERE- %%HP: T(3)A(R)F(.); "D9D20ECE819FF30D9D2088130FB4C18DA1644230D82C1B2130B21309A53" --------------------------------------------------END_HERE-- (Please note that due to a (completely unrelated) system crash on my 48, and the fact that UB is on vacation now, I've been unable to restore my memory; I therefore do not have anyway at the moment of getting this to my 48 to test. The only possible problem could be at routine 61ad8, if this is incorrectly documented a problem could show up; otherwise there is nothing Ican see that could cause this program to work other than as intended. This is mainly why I put up the USE AT YOUR OWN RISK note in the rplc version as included above. I trust Derek. Do you?) ;^) (Smilies sure help one to find missing closing parentheses.....) Enjoy, and I hope someone can find it useful! -JimC -- James H. Cloos, Jr. Phone: +1 716 673-1250 cloos@ACSU.Buffalo.EDU Snail: PersonalZipCode: 14048-0772, USA cloos@ub.UUCP Quote: <>