home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / MISC_ASM.ZIP / UUE12.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-11-11  |  16.5 KB  |  530 lines

  1.     name    UUENCODE
  2.     page    55,132
  3.     title   'UUENCODE.ASM'
  4. ;
  5. ; UUENCODE.ASM -- UUEncodes a Binary File
  6. ;
  7. ; Cmd line processing, general layout from UU.ASM by Theodore A. Kaldis
  8. ;
  9. ;Author:  David Kirschbaum
  10. ;      Toad Hall
  11. ;      kirsch@braggvax.ARPA
  12. ;Released to Public Domain
  13. ;
  14. ; To assemble and link this program into the executable UUENCODE.COM:
  15. ; (It will NOT run compiled as an .EXE program!)
  16.  
  17. ;        MASM UUE;
  18. ;        LINK UUE;
  19. ;        (If you just have EXE2BIN:
  20. ;          EXE2BIN UUE
  21. ;          REN UUE.BIN UUENCODE.COM (or whatever)
  22. ;        (If you have Public Domain EXE2COM or equivalent:
  23. ;          EXE2COM UUE
  24. ;          REN UUE.COM UUENCODE.COM (or whatever)
  25. ;        (Delete the bogus .OBJ file.)
  26.  
  27. ;v1.3, 9 Nov 88
  28. ; - Tightening again.
  29. ;   BP holds binary character count throughout each line uuencoding.
  30. ;   Tightened uuencoding algorithm itself (fewer shifts & register shuffling).
  31. ; - Bumping prompted input filename input to 80 chars.
  32. ; - Different (faster) way of testing:
  33. ;     (1) if we've hit end of the binary read buffer.
  34. ;     (2) if we've completed 60 uuencoded output characters.
  35. ; - Changing READSIZE to a MOD 3 so we lessen problems from reading
  36. ;   non-MOD 3 numbers of binary characters (until the LAST read).
  37. ;   This (and other fixes) finally fixed the problem with 'non-MOD 3'
  38. ;   sized binary files adding bogus uuencoded bytes to the end.
  39. ; - Found (and fixed) new bug: one junk byte sneaking in after a binary
  40. ;   buffer refill from file read.  (Problem was uuencoded buffer overlying
  41. ;   binary buffer.)
  42. ;
  43. ;v1.1, 7 Sep 88
  44. ; - Provisional compilation .. Set STDOUT to 1 to enable redirection.
  45. ;   Else it'll use the default "filename.uue" format.
  46. ; - Fixed bug in filename parsing (need to find the SECOND '\' when
  47. ;   stripping paths!
  48.  
  49. ;v1.0, 6 Sep 88
  50. ;Hacked together from Kaldis' UU.ASM, the public domain UUENCODE.C,
  51. ; UUENCODE.PAS, etc.
  52. ;Uses same algorithm (kinda) as the Turbo Pascal UUENCODE.PAS (not the
  53. ;C version which does too much bit fiddling).
  54. ;
  55. ; - The last few uuencoded characters are coming out different from the
  56. ;   products of UUENCODE.PAS and my Unix mainframe's uuencode.  (Actually,
  57. ;   they're ALL different!)  Doesn't seem to matter:  .ARC files, when
  58. ;   uuencoded and then uudecoded again, still check out.  Might bite us
  59. ;   somewhere, but haven't had any problems in lots of tests.
  60. ;
  61. ; David Kirschbaum
  62. ; Toad Hall
  63. ; kirsch@braggvax.ARPA
  64. ;-------------------------------------------
  65. LF        EQU    10
  66. CR        EQU    13
  67. CMD_TAIL    EQU    80H        ;PSP cmd line offset
  68. READSIZE    EQU    45000        ;max bytes for a binary file read.
  69.                     ;Small enough to fit within our
  70.                     ;64Kb code/data space.  Size must
  71.                     ;be an even divisor of 3.
  72. LINELEN        EQU    60        ;nr chars in a uuencoded line
  73.  
  74. STDOUT        EQU    0        ;change to non-0 to enable redirection
  75.  
  76. Cseg    SEGMENT PARA PUBLIC 'CODE'
  77.     ASSUME  CS:Cseg,DS:Cseg, ES:Cseg
  78.     org    100H
  79.  
  80. UuEncode    PROC    near
  81.     jmp    Start            ;jump over data
  82.  
  83.     IF    STDOUT
  84. usage        db    'UUENCODE [d:][\path\]binary.fil [>output] <RETURN>'
  85.         db    CR,LF,'(Uses redirection)'
  86.     ELSE
  87. usage        db    'UUENCODE [d:][\path\]binary.fil <RETURN>',CR,LF
  88.         db    'produces binary.UUE on current drive\path.'
  89.     ENDIF
  90.         db    CR,LF,'$'
  91.  
  92. msg_v1        DB      'This program requires DOS V2.0 or higher.',CR,LF,'$'
  93.  
  94. pr_inp        DB    CR,LF,'Input path/file:  '
  95. PR_INP_LEN    EQU    $-pr_inp
  96.  
  97. err_inp        DB      'Input file error.',CR,LF
  98. ERR_INP_LEN    EQU    $-err_inp
  99.  
  100. err_out        DB      'Output file error.',CR,LF
  101. ERR_OUT_LEN    EQU    $-err_out
  102.  
  103. end_msg        DB      '`',CR,LF,'end',CR,LF
  104. END_MSG_LEN    EQU    $-end_msg
  105.  
  106. no_action    db    'No action',CR,LF,'$'
  107.  
  108. inp_handle    DW    0        ;input file handle
  109. out_handle    DW    1        ;output file handle (default StdOut)
  110. read_count    DW    data_buf     ;nr binary bytes read        v1.2
  111. last_flag    db    0        ;set true when partial read
  112. ;-------------------------------------------
  113.  
  114. Start:
  115. ;v1.2 Insure we're DOS 2.0 or above (or handles won't work!)
  116.     MOV    AH,30h            ;get DOS version
  117.     INT    21h
  118.     CMP    AL,2            ;2.0 or above?
  119.     JAE    Chk_Cmd            ;yep, ok            v1.2
  120.      MOV    DX,OFFSET msg_v1    ;'DOS 2.0 or above'
  121. Msg_Die:
  122.      MOV    AH,9            ;display string
  123.      INT    21h
  124.      mov    ax,4C01H        ;terminate, ERRORLEVEL 1
  125.      int    21H
  126.  
  127. ;-------------------------------------------
  128. ;Check our PSP command line for a target filename.
  129. Chk_Cmd:
  130.     MOV    SI,CMD_TAIL        ;move cmd line parm
  131.     MOV    DI,offset inp_fil    ;to our filename buffer
  132.     CLD                ;insure fwd
  133.     LODSB                ;cmd line length byte
  134.     or    al,al            ;nothing there?
  135.     jz    Prompt_User        ;yep, nothing there        v1.2
  136.  
  137.     mov    ah,20H            ;get a handy space
  138. Strip_Ct:
  139.     LODSB                ;next cmd line char
  140.     CMP    AL,ah            ;gobble spaces,tabs, etc.
  141.     JBE    Strip_Ct
  142. Ct_Char:
  143.     CMP    AL,ah            ;ctrl char? (e.g., CR)
  144.     JBE    Prog_Go            ;yep, done            v1.2
  145.     STOSB                ;stuff filename byte
  146.     LODSB                ;snarf next cmdline char
  147.     JMP    SHORT Ct_Char        ;and loop
  148. ;-------------------------------------------
  149. ;Protect DI .. it points to
  150. ; (1)    the filename buffer byte just beyond our file name
  151. ;    (so we can AsciiZ) or
  152. ; (2)    to filename buffer start (indicating no input!).
  153.  
  154. Prog_Go:
  155.     cmp    di,offset inp_fil    ;did we get a cmd line filename?
  156.     ja    Open_Inp_Fil        ;yep
  157.  
  158. ;Ok, let's prompt our user:
  159. Prompt_User:
  160.     MOV    DX,OFFSET pr_inp    ;'Input/file name:' prompt
  161.     MOV    CX,PR_INP_LEN        ;nr chars to display
  162.     MOV    BX,1            ;default output handle
  163.     MOV    AH,40h            ;write to file or device
  164.     INT    21h
  165.  
  166. ;Get user's kbd input
  167.     mov    dx,di            ;DI points to filename buff start
  168.     MOV    CX,80            ;up to 80 chars            v1.2
  169.     xor    bx,bx            ;standard input handle
  170.     MOV    AH,3Fh            ;read from file or device
  171.     INT    21h
  172.     add    di,AX            ;nr bytes read
  173.     inc    di            ;adjust for add            v1.2
  174.     inc    di            ;..and CR            v1.2
  175.  
  176. Open_Inp_Fil:
  177.     MOV    DX,offset inp_fil    ;input filename buffer
  178.     cmp    di,dx            ;no name at all?
  179.     ja    Open1            ;ok, continue
  180.      mov    dx,offset usage        ;'Usage..'
  181.      mov    ah,9            ;display str
  182.      int    21H
  183.      mov    dx,offset no_action    ;'No action'
  184.      jmp    short Msg_Die        ;display, terminate
  185.  
  186. Open1:
  187.     MOV    AX,3D00h        ;open file
  188.     mov    [di],al            ;make input filename AsciiZ
  189.     INT    21h
  190.     JNC    Inp_Open        ;went ok
  191.      JMP    Inp_Err            ;input file open error, die
  192.  
  193. ;-------------------------------------------
  194. Inp_Open:
  195.     MOV    inp_handle,AX        ;save input file handle
  196.  
  197. ;Take input file name (up to file separator) (no paths)
  198. ;move "filename.typ" into our uuencoded buffer and write to file.
  199. ;First scan for any paths, drives, etc.
  200. ;DI points to the last filename char+1, so we can compute length.
  201.  
  202.     mov    si,offset inp_fil    ;remember input filename buff start
  203.     mov    cx,di            ;last char+1
  204.     sub    cx,si            ;-start = nr chars+1
  205.     dec    cx            ;adjust
  206. ;We'll start at the end and scan back toward the front.
  207. ;Remember, scasb decrements DI even if it finds the scan char,
  208. ;so we'll have to adjust after the find.
  209.     mov    al,'\'            ;first scan for paths
  210.     std                ;going backwards
  211.     repne    scasb
  212.     cld                ;set back forward again
  213.     jz    Found_Path        ;DI points to char before '\'
  214.     mov    di,si            ;back to start
  215.     cmp    byte ptr [di+1],':'    ;how about a drive?
  216.     jne    Name_Start        ;nope, use buffer start
  217.                     ;else fall thru and bump di past 'd:'
  218.  
  219. ;DI's now pointing at the REAL target file name starting char
  220. ;(past the drive, paths, etc.)
  221. ;We first move the original target file name into our uue buffer
  222. ;(which is initialized with the "start 644 " characters).
  223. ;This uue buffer will be written as the first line of our uuencoded file.
  224.  
  225. Found_Path:
  226.     inc    di            ;adjust for scasb or 'd:'
  227.     inc    di
  228. Name_Start:
  229.     mov    si,di            ;move from input name start
  230.     mov    dx,si            ;save starting point a sec
  231.     mov    di,offset uue_filename    ;move to within uue buffer
  232. OutName_Loop:
  233.     lodsb                ;snarf each char
  234. ;    stosb                ;and stuff to output file name buff
  235. ;    or    al,al            ;0 means filename end
  236. ;    jnz    OutName_Loop        ;move the whole thing
  237. ;    dec    di            ;back up from last stosb
  238.  
  239.     or    al,al            ;0 means filename end        v1.2
  240.     jz    OutName_Done        ;done                v1.2
  241.     stosb                ;stuff filename char        v1.2
  242.     jmp    OutName_Loop        ;keep going            v1.2
  243.  
  244. OutName_Done:                ;v1.2
  245.     mov    ax,0A0DH        ;get CR/LF            v1.2
  246.     stosw                ;stuff it in uuencode buffer
  247.  
  248. ;target file name has now been moved into a starting uuencoded file
  249. ;text line (to include CR/LF).
  250.  
  251.     IF    STDOUT            ;use StdOut redirection
  252.     mov    cx,di            ;ptr to last filename char +1
  253.     ELSE                ;create 'filename.uue'
  254.  
  255.     push    di            ;remember that ending psn
  256.  
  257. ;Now to create our output file name: filename.uue
  258.  
  259.     mov    si,dx            ;SI is PSP target filename start
  260.     mov    di,offset out_fil    ;move to output file name buffer
  261.     mov    dx,di            ;we'll need it here also
  262. Uue_Name_Loop:
  263.     lodsb                ;snarf each char
  264.     or    al,al            ;0 means filename end
  265.     jne    Check_Dot        ;nope
  266.      mov    al,'.'            ;no file type, so fake it
  267. Check_Dot:
  268.     stosb                ;stuff name char into output name
  269.     cmp    al,'.'            ;go up to separator
  270.     jne    Uue_Name_Loop        ;not yet
  271. ;We've now moved the file name (plus the '.') into our output buffer.
  272. ;Time for the type
  273.     mov    ax,'uu'            ;'uue'
  274.     stosw                ;stuff
  275.     mov    ax,'e'            ;'e', DOS AsciiZ terminator    v1.2
  276.     mov    [di],ax            ;stuff                v1.2
  277.  
  278. ;DX has output filename starting ofs.
  279. ;ptr to last byte in uue buffer is on the stack.
  280.     xor    cx,cx            ;normal file attrib (R/W)
  281.     mov    ah,3CH            ;create file
  282.     int    21H
  283.     pop    cx            ;restore uue ptr into CX
  284.     jnb    Create_Ok        ;ok
  285.      jmp    Out_Err            ;'Output file error', die
  286.  
  287. Create_Ok:
  288.     mov    out_handle,ax        ;save output handle
  289.  
  290.     ENDIF                ;StdOut or filename.uue
  291.  
  292.     mov    dx,offset uue_out    ;'start 644 filename.typ', CR/LF
  293.     sub    cx,dx            ;last char-buff start = bytes to write
  294.     call    Write_File        ;write that record
  295. ;Write_File set DI to offset uue_out+1,BP=0
  296.  
  297. Read_Loop:
  298.     CALL    Read_File        ;do the initial binary read
  299.     jz    Write_Uue_End        ;nothing read, done with input    v1.2
  300.  
  301. ;Read_File set SI to offset data_buf, didn't touch DI output buffer ptr,
  302. ;or BP binary byte counter.
  303.  
  304. Uue_Loop:
  305. ;SI and BP are incrementing as we uuencode 45 bytes of binary data
  306. ;into 60 bytes of 'ready to Asciify' data.
  307.     mov    cx,0604H        ;handy constant            v1.2
  308.                     ;CL=4,CH=6            v1.2
  309.  
  310.     lodsb                ;hunk[1]
  311.     mov    ah,al            ;AH, AL=hunk[1]
  312.     shr    al,1            ;quad[1] = hunk[1] SHR 2    v1.2
  313.     shr    al,1            ;(faster this way)        v1.2
  314.     stosb                ;= quad[1], stuff
  315.  
  316.     lodsb                ;AL=hunk[2]
  317.     mov    dl,al            ;save hunk[2] a sec
  318.     shl    ah,cl            ;hunk[1] SHL 4
  319.     shr    al,cl            ;hunk[2] SHR 4
  320.     add    al,ah            ;shifted hunk[1]+shifted hunk[2]
  321.     stosb                ;= quad[2], stuff
  322.  
  323.     mov    ah,dl            ;AH=orig hunk[2]
  324.     lodsb                ;AL=hunk[3]
  325.     mov    dl,al            ;save hunk[3] in DL a sec
  326.     shl    ah,1            ;hunk[2] SHL 2            v1.2
  327.     shl    ah,1            ;(faster this way)        v1.2
  328.     mov    cl,ch            ;CL now 6
  329.     shr    al,cl            ;hunk[3] SHR 6
  330.     add    al,ah            ;shifted hunk[2]+shifted hunk[3]
  331.     stosb                ;= quad[3], stuff
  332.  
  333.     mov    al,dl            ;AL=orig hunk[3]
  334.     stosb                ;= quad[4], stuff
  335.  
  336. ;That 3-byte hunk is done.  See if our binary buffer's empty.
  337. ;Notice we ALWAYS assume we did all 3 binary bytes.
  338. ;If we didn't (e.g., had a non-MOD 3 nr of binary bytes in our file),
  339. ;we'll correct that later with an adjustment to the binary counter
  340. ;character in the uuencoded line.
  341.  
  342.     add    bp,3            ;+3                v1.2
  343.     cmp    si,read_count        ;hit data end yet?        v1.2
  344.     jnb    Chk_Eof            ;yep, see if file is done    v1.2
  345.  
  346. ;Binary file is not done, so see if the line is ready to be finished up
  347. ;and written out to uuencoded file.
  348.     cmp    bp,45            ;done a line of binary data yet? v1.2
  349.                     ;(45 binary bytes = 60 uuencoded)
  350.     jb    Uue_Loop        ;not yet            v1.2
  351.      call    Write_Uue        ;stuff binary count in record,
  352.                     ;Asciify entire record,
  353.                     ;append CR/LF, write to file
  354.                     ;Reset BP binary counter=0,
  355.                     ;DI back to output buffer start +1
  356.     jmp    Uue_Loop        ;Keep working through binary buffer.
  357.  
  358. Chk_Eof:
  359.     cmp    last_flag,1        ;Was last read the binary file EOF?
  360.     jne    Read_Loop        ;nope, do another read, maybe end.
  361.  
  362. ;-------------------------------------------
  363. Write_Uue_End:
  364.     or    bp,bp            ;any bytes uuencoded?        v1.2
  365.     jz    No_Partial_Write    ;none                v1.2
  366.  
  367. ;In converting 3 binary bytes to 4 quad chars, we may have bumped SI
  368. ;beyond the actual number of binary bytes read.
  369. ;By subtracting the original count of bytes read from SI,
  370. ;we'll get the number of 'bogus' binary bytes in that last quad.
  371. ;Subtract that from the BP binary counter, and we'll get the TRUE
  372. ;number of binary bytes in that uuencoded line.
  373. ;It's up to the uudecoding program to catch that difference
  374. ;and ignore the extra quads.  (The ones I've tested seem to.)
  375.  
  376.      sub    si,read_count        ;check for overrun        v1.2
  377.      sub    bp,si            ;subtract any bogus bytes    v1.2
  378.      call    Write_Uue        ;write partial line
  379.  
  380. No_Partial_Write:
  381.     mov    dx,offset end_msg    ;'end',CR/LF
  382.     mov    cx,END_MSG_LEN        ;nr bytes to move
  383.     call    Write_File        ;do the last write
  384.  
  385. ;Funny .. this program runs just fine without any file closing
  386. ;at all!  DOS must take care of it all at the termination.!
  387. ;Still, just to be neat...
  388.  
  389.     IF    NOT STDOUT        ;no StdOut
  390.     mov    bx,out_handle        ;output file handle
  391.     mov    ah,3EH            ;close the file
  392.     int    21H
  393.     ENDIF
  394.  
  395. File_End_X:
  396.     MOV    AH,4Ch            ;terminate, ERRORLEVEL ?
  397.     INT    21h
  398. UuEncode    endp
  399.  
  400. ;-------------------------------------------
  401.  
  402. Write_Uue    PROC    NEAR
  403. ;Enter with DI pointing to char beyond last uuencoded char.
  404. ;Stuff CR/LF, compute line length, write to file.
  405.     push    si            ;save input ptr a sec
  406.     MOV    DX,offset uue_out    ;output line start (length byte)
  407.     mov    cx,di            ;current output pointer
  408.     sub    cx,dx            ;- buffer start = nr bytes in line
  409.                     ;+1, but that's ok since we're adding
  410.                     ;the line_len byte
  411.     push    cx            ;save full line length for later
  412. ;Do the last masking of the line of quads
  413.     mov    si,dx            ;point to line start for 'from'
  414.     mov    di,dx            ;moving to same place
  415.     mov    ax,bp            ;binary bytes in this line    v1.2
  416.     mov    [si],al            ;stuff binary length byte    v1.2
  417.                     ; (uuencode later)
  418.     mov    ah,20H            ;get a handy constant
  419.  
  420. ;Gotta process every byte, masking, checking for spaces, etc.
  421. ;This includes that length byte.
  422.     mov    bx,(3FH SHL 8) + 96    ;get another handy constant    v1.2
  423.                     ;BH=3FH, BL=96            v1.2
  424. Mask_Loop:
  425.     lodsb                ;get output line char
  426.     and    al,bh    ;3FH        ;six-bit mask            v1.2
  427.     add    al,ah            ;plus asciifying offset
  428.     cmp    al,ah            ;end up with a space
  429.     jne    Not_Space        ;nope
  430.      mov    al,bl    ;96        ;use space substitute "`"    v1.2
  431. Not_Space:
  432.     stosb                ;stuff it back in line buffer
  433.     loop    Mask_Loop        ;do them all
  434.     pop    cx            ;restore char count for bytes to write
  435. ;DI now points at char just beyond uuencoded char line
  436.     mov    ax,0A0DH        ;Get CR/LF            v1.2
  437.     mov    [di],ax            ;stuff them in buffer
  438.     inc    cx            ;add in CR/LF to length        v1.2
  439.     inc    cx            ;                v1.2
  440.     pop    si            ;restore SI
  441. Write_File:
  442.     MOV    BX,out_handle        ;output file handle
  443.     MOV    AH,40h            ;write to file/device
  444.     INT    21h
  445.     jb    Out_Err            ;write error
  446.      mov    di,dx            ;point DI back to uue_out start
  447.      inc    di            ;bump past length byte
  448.      xor    bp,bp            ;reset byte ctr            v1.2
  449.      RET                ;write done
  450.  
  451. ;Output file write error
  452. Out_Err:
  453.     MOV    DX,OFFSET err_out    ;'Output file error'
  454.     MOV    CX,ERR_OUT_LEN        ;msg length
  455.     jmp    short Fatal_Error    ;common code
  456.  
  457. Write_Uue    ENDP
  458.  
  459. ;-------------------------------------------
  460. ;Read a chunk of raw binary data
  461. Read_File    PROC    NEAR
  462.     MOV    DX,offset data_buf    ;into binary input buffer
  463.     mov    cx,READSIZE        ;nr bytes to read
  464.     MOV    BX,inp_handle        ;input file handle
  465.     MOV    AH,3Fh            ;read from file/device
  466.     INT    21h
  467.     jb    Inp_Err            ;failed
  468.  
  469. ;AX has nr of bytes read
  470.     mov    si,dx            ;SI needs offset data_buf    v1.2
  471.     mov    bx,dx            ;buffer start            v1.2
  472.     add    bx,ax            ;+bytes read = data end        v1.2
  473. ;BX points to the next 'empty' byte (data_buf start + bytes read)
  474.  
  475.     cmp    ax,cx            ;read a full buffer?
  476.     je    Read_Full        ;yep, no fiddling required
  477.  
  478. ;We've read less than a buffer full.  Let's make sure the last bytes
  479. ;are nulls if bytes read are not MOD 3.
  480.     mov    word ptr [bx],0        ;stuff 2 nulls there        v1.2
  481.     mov    last_flag,1        ;turn EOF flag on
  482.  
  483. Read_Full:
  484.     mov    read_count,bx        ;point to data end        v1.2
  485.     or    ax,ax            ;set flags for return        v1.2
  486.     RET                ;read done
  487.  
  488. ;-------------------------------------------
  489. ;Input file read error.  Error value in AL
  490. Inp_Err:
  491.     MOV    DX,OFFSET err_inp    ;'Input file error'
  492.     MOV    CX,ERR_INP_LEN        ;msg length
  493. ;Common code added here
  494. Fatal_Error:
  495.     push    ax            ;save error in AL
  496.     call    Say_Error        ;common code
  497.     POP    AX            ;restore error in AL
  498.     JMP    File_End_X        ;terminate
  499. Read_File    ENDP
  500.  
  501. ;-------------------------------------------
  502. Say_Error    proc    near
  503.     MOV    BX,2            ;Std ErrOut handle
  504.     MOV    AH,40h            ;write to file/device
  505.     INT    21h
  506.     RET
  507. Say_Error    ENDP
  508.  
  509. ;using pointers here at code end for various buffers.
  510. ;the uue_out buffer is normally 60 uuencoded chars, plus CR/LF
  511. ;It's initialized with the default uuencode file header.
  512. ;No, I don't know the magic in '644'.
  513.  
  514.         EVEN            ;v1.2
  515. uue_out        db    'begin 644 '    ;first write contains this + name
  516.  
  517. ;The rest of these buffers don't take any code space.
  518.  
  519. uue_filename    equ    $        ;where we move filename.uue
  520. ;Leave room for LINELEN+2 chars for uue_out buffer.
  521. inp_fil        equ    uue_out  + LINELEN +2    ;80 chars long        v1.2
  522.  
  523. ;Leave room for 80 chars for inp_fil filename buffer.
  524. out_fil        equ    inp_fil + 80    ;15 bytes long            v1.2
  525.  
  526. data_buf    equ    out_fil        ;leave room for uue_out        v1.2
  527.  
  528. Cseg    ENDS
  529.     END    UuEncode
  530.