RosettaCodeData/Task/Bitwise-IO/PL-I/bitwise-io.pli
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

11 lines
313 B
Text

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);