.TITLE UUDUMP uuencoded dump .IDENT /01/ .MCALL .CSIGEN,.READW,.PRINT,.CLOSE,.EXIT ; ; UUDUMP performs the same function as uuencode on other systems, it converts ; the contents of a file to printable ASCII characters. Each triple of bytes ; of the input file are converted to a quadruple of printable ASCII characters, ; each representing 6 bits of information from the input bytes. ; Note that this version uses a fixed filename in the output, "diskimage.img". ; ; 11-JUL-2004 H. Rosenfeld ; .ENABL REG .GLOBL UUENC .CSECT START: .CSIGEN #DHANDL,#DEFEXT BCC 1$ .PRINT #CSIERR .EXIT 1$: .PRINT #BEGIN READ: .READW #IOBLK,#3,#BUFFER,#400,BLKNO BCC BLOCK .PRINT #END .CLOSE #0 .EXIT BLOCK: MOV #BUFFER,R1 MOV #LINBUF,R2 MOV #13,R3 ; 13(8) full lines per block LINE: MOV #55,R0 ; 55(8) bytes per encoded line JSR PC,UUENC .PRINT #LINBUF SOB R3,LINE MOV #21,R0 JSR PC,UUENC .PRINT #LINBUF INC BLKNO BR READ .PSECT DATA DEFEXT: .RAD50 /SAV/ .RAD50 /UU UU UU / CSIERR: .ASCIZ /COULD NOT OPEN FILE/ BEGIN: .ASCIZ /begin 644 diskimage.img/ END: .BYTE '`,15,12 .ASCIZ /end/ .EVEN LINBUF: .BLKW 40 BUFFER: .BLKW 400 BLKNO: .BLKW 1 IOBLK: .BLKW 10 DHANDL: .END START