Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!noose.ecn.purdue.edu!en.ecn.purdue.edu!wscott From: wscott@en.ecn.purdue.edu (Wayne H Scott) Newsgroups: comp.sys.handhelds Subject: ASC to bin program Message-ID: <1990Dec9.201154.21797@en.ecn.purdue.edu> Date: 9 Dec 90 20:11:54 GMT Organization: Purdue University Engineering Computer Network Lines: 38 The following is a script that I have found useful. It will read a text file containing a program encoded in the ->ASC format and extract the binary file. I use this to speed downloads to my HP. And I don't need the ->ASC program on the 48. It is written in perl so I realize that many people will not be able to use it. Someday the rest of the world will understand. #!/usr/unsup/perl # unasc # A perl program to extract a HP-48 binary from a text file containing a # ->ASC program. # # Usage: unasc file > binfile # # Written by Wayne Scott 1990 while (<>) { next if (!(/^%%HP/../"$/)); # Skip everything but program chop; $file .= $_; } $file =~ s/.*"(\w*)\w\w\w\w".*/\1/; # strip newlines, ", and CRC $file =~ s/(.)(.)/pack(C,hex(\1.\2))/eg; # convert ascii to bin print $file; -- _______________________________________________________________________________ Wayne Scott | INTERNET: wscott@ecn.purdue.edu Electrical Engineering | BITNET: wscott%ecn.purdue.edu@purccvm Purdue University | UUCP: {purdue, pur-ee}!ecn.purdue.edu!wscott