RosettaCodeData/Task/Bitwise-IO/PL-I/bitwise-io.pli

12 lines
313 B
Plaintext

declare onebit bit(1) aligned, bs bit (1000) varying aligned;
on endfile (sysin) go to ending;
bs = ''b;
do forever;
get edit (onebit) (F(1));
bs = bs || onebit;
end;
ending:
bs = bs || copy('0'b, mod(length(bs), 8) );
/* pad length to a multiple of 8 */
put edit (bs) (b);