[comp.sys.atari.8bit] UUDECODERS complete kit

curzon@kaoa01.dec.com (Richard Curzon KAO4-3/7A DTN 621-2196) (10/30/87)

Some netters seem to have missed the recent posting of YAU, and others can't
use it without having a UUdecoder to decode the UUdecoder. 

For those unhappy campers who are missing some of the parts, here is the 
complete 

               8 bitters all-in-one UUDECODING KIT
               ===================================

You either get every thing you need, or you don't know you missed 
anything.

Contents:

1) NEWUUDEC.BAS  (bootstrap)

    John Sangster's ground breaking UUdecoder v1.2, not only 

  - shows how fast BASIC can be with intelligent use of machine code
subroutines, but also 

  - has the virtue that it can be represented in ASCII here on the 
net.  You can "ENTER" it directly into BASIC.  If you always work in
BASIC, this may be the only UUdecoder you need. 

     Otherwise, you can use this program to decode YUA.COM, which is 
a standalone machine code program, which works with or without BASIC 
present.

2) YAU.COM

     John R Dunnings program is now the UUdecoder to beat for speed and 
ease of use.  Must be itself UUdecoded (see 1 above).

3) YAUE.COM

     JRD's encoder program.

4) YAU.DOX

     abbreviated docs for YAU and YAUE (sorry JRD, hope you don't mind my
     editing).  People prefer to find out how to use these things by
     effing around no matter what the risks ;-).

------------------------------newuudec.bas-------------------------------------
1 GOTO 100:REM jump around time-critical stuff to start up program.
2 M=USR(UUDADR)
10 IF M=0 THEN 2090
20 IF M>OBUFDIM THEN ? "Error at line 20, M=";M:GOTO 3000
30 PRINT #2;OBUF$;:BYTES=BYTES+M
40 INPUT #1,IBUF$:L=LEN(IBUF$)+1:IF L<62 THEN IBUF$(L)=" ":IBUF$(L+1)=IBUF$(L)
50 GOTO 2
100 ? "Uudecode Ver. 1.2a":? "Report errors to John Sangster at"
101 ? "(617) 235-8753/jhs@mitre-bedford.arpa":? 
102 POKE 6,1:REM Turn BASIC flag ON.
105 DIM OBUF$(80),IBUF$(62),OFILE$(16),IFILE$(16),A$(1)
110 DIM UUDECODE$(400)
120 UUDADR=ADR(UUDECODE$):IBUF=ADR(IBUF$):OBUF=ADR(OBUF$)
130 OBUFDIM=80:UUDDIM=400:BEEP=150:RETRY=500
140 GOTO 200
149 REM BEEP Subroutine:
150 SOUND 0,85,10,15:FOR I=1 TO 80:NEXT I:SOUND 0,0,0,0:RETURN 
199 END 
200 ? "Loading uudecode subroutine..."
201 RESTORE 4000:POKADR=UUDADR:MAXADR=POKADR+UUDDIM-1:PRGTOP=UUDADR-1
202 READ X:IF X=255 THEN READ X:IF X=255 THEN 204
203 ? "BAD LOAD FILE FOR UUD":END 
204 READ LO1,HI1,LO2,HI2:BYTES=HI2*256+LO2-(HI1*256+LO1)+1:PRGTOP=PRGTOP+BYTES
205 IF BYTES<0 OR BYTES>UUDDIM THEN ? "BYTE COUNT ERROR FOR UUD":END 
206 FOR I=1 TO BYTES:READ X:POKE POKADR,X:POKADR=POKADR+1:IF POKADR>MAXADR THEN ? "UUD STRG OVFLOW!":END 
207 NEXT I
208 TRAP 209:READ LO1,HI1,LO2,HI2:BYTES=256*HI2+LO2-(256*HI1+LO1)+1
209 PRGTOP=PRGTOP+BYTES:IF LO1<>224 OR HI1<>2 THEN 206
500 REM COMMAND DISPATCHER
530 ? :? "INPUT FILE";:INPUT IFILE$:IF LEN(IFILE$)=0 THEN 530
540 ? :? "OUTPUT FILE SPEC OR":? "DEFAULT DEVICE ID";:INPUT OFILE$
550 L=LEN(OFILE$):IF L=0 THEN OFILE$="D1:":? :? "Output to D1: assumed.":? 
2000 ? "Beginning uudecode processing..."
2011 IBUF$(1,1)=" ":M=USR(UUDADR,IBUF,OBUF):IF M<>0 THEN ? "Error in initializing UUDECODE, line 2011; M=";M:? :END 
2019 TRAP 2020:CLOSE #1:OPEN #1,4,0,IFILE$:GOTO 2030
2020 ? "INPUT FILE NOT FOUND":GOSUB BEEP:GOTO RETRY
2030 INPUT #1,IBUF$:BYTES=0
2035 L=LEN(IBUF$):IF L>5 THEN L=5
2036 IF L=0 THEN L=1:IBUF$=" "
2040 TRAP 2095:IF IBUF$(1,L)<>"begin" THEN 2030:REM skip header
2042 ? IBUF$:REM Print "begin" line to screen & get OFILE$ if default case.
2043 L=LEN(OFILE$):IF L<=0 OR OFILE$(L)=":" THEN 2046
2044 TRAP 2050:CLOSE #2:OPEN #2,8,0,OFILE$:TRAP 2095:GOTO 40
2046 L=LEN(IBUF$):FOR I=L TO 1 STEP -1
2047 IF IBUF$(I,I)<>" " THEN 2049
2048 OFILE$(4)=IBUF$(I+1,L):GOTO 2044
2049 NEXT I
2050 ? "OUTPUT FILESPEC":INPUT OFILE$:IF LEN(OFILE$)=0 THEN 2050
2052 GOTO 2044
2090 INPUT #1,IBUF$:IF IBUF$(1,3)="end" THEN PRINT IBUF$:GOTO 3000
2095 NERR=PEEK(195):IF NERR=136 THEN PRINT "EOF unexpected!":GOTO 3000
2097 ? "Error Code=";NERR
3000 ? "Done!":CLOSE #1:CLOSE #2:? "Output byte count = ";BYTES:? :? 
3010 ? "More files to decode (Y/N)";:INPUT A$:IF A$="Y" OR A$="y" THEN 500
3020 DOS 
4000 DATA 255,255,8,6,3,7
4010 DATA 104,240,67,170,56,233
4020 DATA 2,240,14,104,104,202
4030 DATA 208,251,169,254,133,212
4040 DATA 169,255,133,213,96,104
4050 DATA 141,1,6,104,141,0
4060 DATA 6,104,141,3,6,104
4070 DATA 141,2,6,165,6,240
4080 DATA 100,165,134,133,203,165
4090 DATA 135,133,204,173,2,6
4100 DATA 56,229,140,133,208,173
4110 DATA 3,6,229,141,133,209
4120 DATA 162,128,208,2,240,72
4130 DATA 160,0,177,203,201,129
4140 DATA 208,42,160,2,177,203
4150 DATA 56,229,208,208,33,200
4160 DATA 177,203,229,209,208,26
4170 DATA 165,203,141,6,6,165
4180 DATA 204,141,7,6,160,6
4190 DATA 177,203,141,4,6,200
4200 DATA 177,203,141,5,6,24
4210 DATA 144,22,24,165,203,105
4220 DATA 8,133,203,144,2,230
4230 DATA 204,202,208,192,169,255
4240 DATA 133,212,133,213,96,234
4250 DATA 173,0,6,133,204,173
4260 DATA 1,6,133,205,160,0
4270 DATA 132,213,177,204,56,233
4280 DATA 32,41,63,133,212,208
4290 DATA 24,165,6,240,19,173
4300 DATA 6,6,133,208,173,7
4310 DATA 6,133,209,160,4,169
4320 DATA 0,145,208,200,145,208
4330 DATA 96,165,6,240,43,173
4340 DATA 4,6,56,229,212,173
4350 DATA 5,6,229,213,16,9
4360 DATA 169,255,133,212,133,213
4370 DATA 32,54,185,173,6,6
4380 DATA 133,208,173,7,6,133
4390 DATA 209,169,0,160,5,145
4400 DATA 208,136,165,212,145,208
4410 DATA 230,204,208,2,230,205
4420 DATA 173,2,6,133,206,173
4430 DATA 4,7,108,7,3,6
4440 DATA 133,207,166,212,160,1
4450 DATA 177,204,56,233,32,133
4460 DATA 203,6,203,6,203,136
4470 DATA 177,204,56,233,32,6
4480 DATA 203,42,6,203,42,145
4490 DATA 206,202,240,68,169,0
4500 DATA 133,208,160,2,177,204
4510 DATA 56,233,32,41,63,74
4520 DATA 102,208,74,102,208,5
4530 DATA 203,136,145,206,202,240
4540 DATA 41,160,3,177,204,56
4550 DATA 233,32,41,63,5,208
4560 DATA 136,145,206,202,240,24
4570 DATA 24,165,204,105,4,133
4580 DATA 204,144,2,230,205,24
4590 DATA 165,206,105,3,133,206
4600 DATA 144,162,230,207,176,158
4610 DATA 96,224,2,225,2,0
--------------------------------yau.uue--------------------------------
begin 666 YAU.COM
M__\ , (P3+=7__\#4&Q2   !         (T,4)A(BDBB (JH("55J0N=0@.My
M#% @5N1HJFBH8$B&AH2'H "QAO .( U0R-#VYH;0\N:'T.YH8$B&AH2'H "Qy
MALF;\ X@#5#(T/3FAM#PYH?0[&A@ $B&AH2'H "QAO .C6-0R+&&( U0SF-0y
MT/5H8*F;3 U0 $A*2DI*((Y0:"D/CH10JKVG4" -4*Z$4&"8((50BB"%4& Py
M,3(S-#4V-S@Y04)#1$5&    R6&0!\E[L ,XZ2!@R3KP'LDN\!K)*O 6R3_Py
M$LDPD S).I *R4&0!,E;D (X8!A@CKA0L8CP$""Z4"#&4+ (S;A0\ 7(T.R@y
M_V    ".!%$898J%CJ6+:0"%C[&(\%S-!%'P5,F;\%/)(/!/R""Z4"#&4+!&y
MR2KP!,D_T I(J0@-!5&-!5%HC+=02* !L8Z@ -&.L!R@ 4@8:0&1CF@8:0*Hy
M:)&.K091#051C0513&Q1:*RW4$P54<@88#A@AHB$B:D C051H *1BJ &D8J@y
M$)&*H "B.B#J4# /J0&-!E&@ *D!( =13*91H "I HT&4:D%HBX@!U&P"*D$y
M#051C051J02-!E&I#Z*;( =1K051H "1BF",N5"LMU"1B.ZW4*RY4&"QBB#0y
M4<C*T/=@L8K(JF"&B(2)H ",MU"@ B#I4? ((-]1J3H@T%&@!B#I4? #(-]1y
MJ2X@T%&@$"#I4? #(-]1J9L@T%%@ (TE4J( H8HM)5+0&;&*T!6AC"TE4O .y
ML8SP"JKHL8R1BLC*T/A@J0&@ B F4JD"H 8@)E*I!* 0("92H "QC!&*D8I@y
M    __^I4ZI3  #__^M3L5E$,3I&3T\N555%FT9/3RY#3TV;  ( (" ( " @y
M(" @(" @ P @("   @ @( @ (" @(" @(" # " @(  " " @"  @(" @(" @y
M( , (" @  ( (" ( " @(" @(" @ P @("!(K050T!>B(*D#H# @'56L!%"My
M U @)56I"R U5:D!C050J0"- U"-!%"I X6"J3"%@VA@2*T$4,D@T ,@3E1Hy
MH "1@AAM"5"-"5"M"E!I (T*4.X&4- ([@=0T /N"%"I (T%4.X#4- #[@10y
MYH+0 N:#8(:*A(NI *  D8J@ I&*H :1BJ 0D8JL:E*Q@,F;\#2,:E*8&&6 y
MJJ6!:0"H('=1($Q2K&I2L8#)F_ 3R2#P!,A,]U3(L8#)F_ $R2#P]8QJ4AA@y
MC&I2($Q2.&"=1 .8G44#8)U( YB=20-@G4H#F)U+ V"=0@,@5N2]0P-@(!U5y
MJ0-,-55(F$BI!*  ("U5:*AH3#]52)A(J0B@ " M56BH:$P_5:(0H%*I;2 =y
M5:G_H  @)56I!2 U5<  , 1(:!A@F$BBEJ!5("M0:""%4"!_4#A@FU)E860@y
M97)R;W(@ *  L0K)3- 0H .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LN@4R!&4"!_4*(@H%.IRR!75< !\"N82*+2H%@@y
M*U!H((50(']03*-93W!E;B!E<G)O<B!O;B!O=71F:6QE.B  J0&-!5 @3E0@y
M9U6P/*)MH%8@3U:0.B +5TSR6$)Y=&4@8V]U;G0@/2  0VAE8VMS=6T@/2 Cy
M> !5;F5X<&5C=&5D($5/1B&; *(BH%D@*U @3E0@G5>B!J!9("M0J0&%U:D y
MA=0@JMD@MMVM"%"%U:D A=0@JMD@V]H@MMVM!E"%U*T'4(75(*K9(&;:(.;8y
MH "Q\T@I?R -4,AHR0 0\B!_4*(4H%D@*U"M"E @A5"M"5 @A5 @?U @G5>My
3JE/0 TRW5R"=5V#__^ "X0*W5P  y
 
end

--------------------------------yaue.uue--------------------------------
begin 666 YAUE.COM
M__\ ,'$R3%LW         (T),)A(BDBB (JH(.,TJ0N=0@.M"3 @5N1HJFBHy
M8$B&AH2'H "QAO .( HPR-#VYH;0\N:'T.YH8$B&AH2'H "QALF;\ X@"C#(y
MT/3FAM#PYH?0[&A@ $B&AH2'H "QAO .C6 PR+&&( HPSF PT/5H8*F;3 HPy
M $A*2DI*((LP:"D/CH$PJKVD," *,*Z!,&"8(((PBB"",& P,3(S-#4V-S@Yy
M04)#1$5&    R6&0!\E[L ,XZ2!@R3KP'LDN\!K)*O 6R3_P$LDPD S).I *y
MR4&0!,E;D (X8!A@CK4PL8CP$""W,"##,+ (S;4P\ 7(T.R@_V    ". 3$8y
M98J%CJ6+:0"%C[&(\%S- 3'P5,F;\%/)(/!/R""W,"##,+!&R2KP!,D_T I(y
MJ0@- C&- C%HC+0P2* !L8Z@ -&.L!R@ 4@8:0&1CF@8:0*H:)&.K0,Q#0(Qy
MC0(Q3&DQ:*RT,$P2,<@88#A@AHB$B:D C0(QH *1BJ &D8J@$)&*H "B.B#Gy
M,# /J0&- S&@ *D!( 0Q3*,QH "I HT#,:D%HBX@!#&P"*D$#0(QC0(QJ02-y
M S&I#Z*;( 0QK0(QH "1BF",MC"LM#"1B.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I 8UQ,JD C50VC54VC58V(#TTC50VK3PTT!_N5S8@/32-53:My
M/#30$>Y7-B ]-(U6-JT\-- #[E<VK50V2DJ-4#:M539*2DI*C5$VK50V"@H*y
M"BDP#5$VC5$VK54V"@HI/(U2-JU6-DI*2DI*2@U2-HU2-JU6-BD_C5,VK'$Ry
MK5 V*3\8:2"9<C+(K5$V*3\8:2"9<C+(K5(V*3\8:2"9<C+(K5,V*3\8:2"9y
M<C+(C'$RK5<VR2VP"*T\-- #3&,VK5<V&&D@C7(RK'$RJ7F9<C+(J9N9<C*By
M<J R("4U&&"B$*D,(/,THB"I#"#S-&!9;W=E92$@ " M/B  J0"-!C"-!S"-y
M S"-!#"-!3"-/#2I 8VO,R!?-9 #3"(YJ2B%BJDTA8NB\* S('0QJ2B%C*DTy
MA8V@-*( (( THK"@,R#K,:(0H#.IL" %-< !\"J82*+!H#<@*#!H(((P('PPy
M3!<Y3W!E;B!E<G)O<B!O;B!I;F9I;&4Z( "I*(6*J32%BZ+[H#,@=#&I*(6,y
MJ32%C2!1,J THA0@@#2I (6,J32%C2!1,J+0H#,@ZS&B3J W("@PHK"@,R!#y
M,*)6H#<@*#"BT* S($,P('PPHB"@,ZG0(!4UP 'P*YA(HDJ@." H,&@@@C @y
M?#!,%SE/<&5N(&5R<F]R(&]N(&]U=&9I;&4Z(  @,38@63:P0ZT\-/#VHBN@y
M-B E-:(MH#8@)35,M#A">71E(&-O=6YT(#T@ $-H96-K<W5M(#T@(W@ 56YEy
M>'!E8W1E9"!%3T8AFP"BG* X("@P(#\WHH"@." H,*D!A=6I (74(*K9(+;=y
MK04PA=6I (74(*K9(-O:(+;=K0,PA=2M!#"%U2"JV2#FV*  L?-(*7\@"C#(y
M:,D $/(@?#"BCJ X("@PK0<P(((PK08P(((P('PP(#\WK:\ST -,6S<@/S=@y
(___@ N$"6S< y
 
end

---------------------------yau.dox--------------------------------------
 
    Yau  can be run two ways:  either from the command line, if you're
    using DOS XL, or by prompting for its  own  commands.   In  either
    case,  the  form  of  the  command  line  to  Yau  is 'source-file
    [target-file]' where target file is optional.  
 
    Examples:  
      If you ARE running DOS XL, you could type:  
 
        YAU D1:FOO.UUE D1:FOO.COM 
 
      If you aren't running DOS XL, or you are but didn't give Yau any
      args when you started it up, it will prompt, as:  
 
        YAU> 
 
      ...to which you could answer 
 
        D1:FOO.UUE D1:FOO.COM 
 
 
    You could say 
 
        YAU FOO D2:  
 
    to  decode  a  file  on  D1:  to a the resultant file on D2:.  

    You could say 
 
        YAU FOO BAR 
 
    to  override  whatever's  in  the 'begin' line, and put the result
    into BAR.COM.  Finally, if YAU senses that it's running under  DOS
    XL, it'll inherit the default device spec, so you're not stuck do-
    ing everything on D1:.
 
    Yau  keeps  a  byte  count  and  simple 16 bit checksum while it's
    decoding;  when it's done with a file, it will display them, as:  
 
        Byte count = 2099 
        Checksum = #x1FC0 
 
    The  byte  count is in decimal, the checksum is in hex;  the #x is
    to remind you that it's hex, in case it's not obvious from the va-
    lue.  The checksum is the running unsigned sum of all the bytes in
    the resultant file, truncated to 16 bits.  
 
 
  YAUE:  Yet Another UU Encoder.  
 
 
    Yaue  is  a companion program to Yau.  It takes binary files (pro-
    grams, archives, etc) and encodes  them  into  text  suitable  for
    sending  through  predatory  mail  systems, etc.    The byte count and 
    checksums for this release are:  

    Yau:  2134. bytes, #x39F2 checksum.
    Yaue: 1988. bytes, #xE74D checksum.
 
    I guess that's about it.  Happy coding!   - JRD


NOTE to spartaDOS users:  Command line is supported, though not 
as completely as for DOS XL.  If you assume no defaults, you will 
be satisfied with the results!  -RC