• One From The Vault: UUDECODE (type-in)

    From Cameron Kaiser@21:1/5 to All on Mon May 31 17:40:01 2021
    ******************************************************************
    *** ***
    *** comp.binaries.cbm is a moderated binaries- ***
    *** only newsgroup (no discussion or ***
    *** crossposting allowed) for Commodore 8-bits ***
    *** ***
    *** For information on comp.binaries.cbm visit ***
    *** http://www.floodgap.com/comp.binaries.cbm/ ***
    *** ***
    *** This file is available via mailing list at ***
    *** http://lists.trikaliotis.net/listinfo/comp-binaries-cbm/ ***
    *** to list subscribers ***
    *** Allow time for submission to be received ***
    *** ***
    ******************************************************************

    * One from the Vault is a collection of frequently requested, useful or just
    plain interesting past posts sent to comp.binaries.cbm, as archived by the
    moderators. If you have a request, please send it to the address in the
    headers. In addition to being selected and reposted by moderation staff,
    some of these postings are regularly posted on Mondays and Fridays on a
    rotating schedule.

    Take care when replying to these messages, as many were posted years ago.


    From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net> >Reply-to: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net> >X-Original-Posting-Date:

    Craig Bruce's UUDECODE program. Type it in to BASIC and you will be
    able to decode messages posted to comp.binaries.cbm in uuencoded format.

    This is a BASIC uudecode program. It would be good for uudecoding files
    until something faster could be obtained. It ignores everything until it
    finds the "begin" statement at the start of a uuencoded file. The file
    must be a sequential PETASCII file and converts it to a program file.
    Since it is in BASIC it is easy to change.

    10 input"enter input file name";fi$
    20 input"enter input device #";di
    30 input"enter output device #";dp
    40 open2,di,2,fi$+",s,r"
    50 print"searching for uu-data start"
    60 gosub360
    70 ifleft$(w$,5)="begin"then90
    80 printw$:goto60
    90 print"beginning data conversion"
    100 print w$
    110 fo$=mid$(w$,11)
    120 open3,dp,3,"@0:"+fo$+",p,w":lc=1
    130 gosub360:print"line ";lc;" "
    140 ifleft$(w$,3)="end"then330
    150 x=2:dl=(asc(left$(w$,1))-32)and63
    160 ifasc(left$(w$,1))=192thendl=0
    170 ob$=""
    180 ifdl=0then130
    190 ll=int((dl+2)/3)*4
    200 forz=0to3
    210 ifx+z-2>=llthenb(z)=0:goto250
    220 c=asc(mid$(w$,x+z,1))
    230 ifc=192thenb(z)=0:goto250
    240 b(z)=(c-32)and63
    250 next:x=x+4
    260 c1=b(0)*4+int(b(1)/16)
    270 c2=((b(1)*16)and240)+int(b(2)/4)
    280 c3=((b(2)*64)and192)+b(3)
    290 ob$=ob$+chr$(c1)+chr$(c2)+chr$(c3)
    300 ifx-2<llthen200
    310 print#3,left$(ob$,dl);:lc=lc+1
    320 goto130
    330 close3
    340 print"conversion complete":goto50
    350 close3:close2:end
    360 w$=""
    370 get#2,x$:ifx$=""thenx$=chr$(0)
    380 ifst<>0andw$<>""thenreturn
    390 ifst<>0thenprint"eof":goto350
    400 ifasc(x$)=13orasc(x$)=10thenreturn
    410 w$=w$+x$
    420 iflen(w$)=254thenreturn
    430 goto370

    Keep on Hackin'!

    -Craig Bruce
    csbruce@ccnga.uwaterloo.ca
    "From each according to his ability, to each according to his ability."

    --
    Cameron Kaiser * ckaiser@floodgap.com * posting with a Commodore 128
    Floodgap Systems: http://www.floodgap.com/
    personal page: http://www.cameronkaiser.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)