Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!MITRE-BEDFORD.ARPA!jhs From: jhs@MITRE-BEDFORD.ARPA.UUCP Newsgroups: comp.sys.atari.8bit Subject: Re: uuencoded uuencode for the 8-bits... Message-ID: <8702062200.AA00982@mitre-bedford.ARPA> Date: Fri, 6-Feb-87 17:00:26 EST Article-I.D.: mitre-be.8702062200.AA00982 Posted: Fri Feb 6 17:00:26 1987 Date-Received: Sun, 8-Feb-87 04:45:26 EST References: <1991@ncoast.UUCP> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 31 The difficulty that Brad has been having with my uudecode seems to be caused by the format of his uuencode output, which does not include the final line containing "zero bytes" to be uudecoded. VAX implementations of uuencode seem to include such a line. This comes out as a line containing just a single space before the . A space is $20 (or decimal 32) in ASCII, so a uudecoder subtracts $20 and gets a byte count of zero. If it is written correctly it decides that (a) there is nothing on that line to uudecode and (b) there are no more lines, either. The next line should contain "end". I wrote the assembly language subroutine to determine that the byte count was zero and return without doing any decoding. It does however return a USR value of 0, which gets put into the M in my BASIC calling program in the line "M=USR(UUDADR)". The next line tests for M=0 as the end condition and returns control down below to the lines which handle finishing up and closing files. In Atari BASIC, if you want high speed, you have to put the critical code right at the beginning, because every time you ask BASIC to GOTO a line number, it has to search through all the stored program steps until it finds a line with that number. If you are searching for a line right at the beginning, the search takes the least possible time. That is why I put the "main loop" at the front, with just one line ahead of it to make the program start up correctly on a RUN command. I also used just the one test for a line with zero bytes in it as the end condition. I felt that this would be a fast test. If you want to, you can make it actually look for the "end" line instead by inserting the test "IF (OBUF$(1,3)="end" THEN GOTO ..." instead of or in addition to the test for M=0. -John S.