Newsgroups: alt.folklore.computers,alt.sys.pdp10 Subject: Re: FTP: ASCII vs Binary vs Tenex (was Re: What is "ASCII"?) References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <BILLW.96Jul29175833@puli.cisco.com> Sender: Joe Smith <firstname.lastname@example.org> In article <BILLW.96Jul29175833@puli.cisco.com>, William <email@example.com> wrote: | Note that "netascii" is actually an RFC-defined machine-independent | representation for text, and this is what the "ascii" command in FTP | refers to.RFC-959 describes the FTP protocol, and refers to TELNET's NVT-ASCII.
On PDP-10 systems, <NULL> characters are stripped out, and LSN (Line Sequence Numbers) from editors like SOS are optionally removed.
On PDP-10 systems, this can be done by reading the file a nybble at a time with a 4-bit byte pointer and sending each pair of nybbles as 8 bits.
Byte 9*n+0 = bits 0-7 of the even numbered word (starting with word 0) Byte 9*n+1 = bits 8-15 of the even word Byte 9*n+2 = bits 16-23 of the even word Byte 9*n+3 = bits 24-31 of the even word Byte 9*n+4 = bits 32-35 of the even word << 4 + bits 0-3 of odd word Byte 9*n+5 = bits 4-11 of the odd numbered word Byte 9*n+6 = bits 12-19 of the odd word Byte 9*n+7 = bits 20-27 of the odd word Byte 9*n+8 = bits 28-35 of the odd word (ending with word 0177 or 0777)
Byte 5*n+0 = 0 << 7 + bits 0-6 of word Byte 5*n+1 = 0 << 7 + bits 7-13 of word Byte 5*n+2 = 0 << 7 + bits 14-20 of word Byte 5*n+3 = 0 << 7 + bits 21-27 of word Byte 5*n+4 = (bit 35 of word) << 7 + bits 28-34 of wordNote that a 36-bit binary file can be transfered to an 8-bit system and then back again without losing any bits. PDP-10 text files are readable asis when transfered to CP/M, MS-DOS, and anythine else that uses <CR><LF> as the line separator on disk.
Later versions of TOPS-10 and TOPS-20 had tape controllers that used microcode in the tape formatter to do this sort of bit shuffling.
This mode is something we used in-house to write to 1/2-inch tapes in 'tar' format. The idea was to create a tape that could be used on our UNIX system with no postprocessing. This meant that file 36-bit file had to be read from disk twice: once to calculate the byte count for the 'tar' header, and another pass to write the data.