codekingpro/portable-devtools
115k
1# This file and how to use it are described in the manual.2# Therefore, we respectfully advise you to Read The Fine Manual3# for more information.4 5# bits2str --- turn an integer into readable ones and zeros6 7function bits2str(bits, data, mask)8{9 if (bits == 0)10 return "0"11 12 mask = 113 for (; bits != 0; bits = rshift(bits, 1))14 data = (and(bits, mask) ? "1" : "0") data15 16 while ((length(data) % 8) != 0)17 data = "0" data18 19 return data20}21 