Compare commits

..

No commits in common. "357da752fc9495912749f0bff148791cd162e66c" and "ff389a171938cd183bef006f7aa8216e6fa1d816" have entirely different histories.

6 changed files with 8 additions and 88 deletions

View File

@ -1,23 +0,0 @@
get_raw_bit(number)
{
local tab = galloc(16);
if (tab == NULL)
return (NULL);
[tab] = number & 0x8000;
[tab + 1] = number & 0x4000;
[tab + 2] = number & 0x2000;
[tab + 3] = number & 0x1000;
[tab + 4] = number & 0x800;
[tab + 5] = number & 0x400;
[tab + 6] = number & 0x200;
[tab + 7] = number & 0x100;
[tab + 8] = number & 0x80;
[tab + 9] = number & 0x40;
[tab + 10] = number & 0x20;
[tab + 11] = number & 0x10;
[tab + 12] = number & 0x8;
[tab + 13] = number & 0x4;
[tab + 14] = number & 0x2;
[tab + 15] = number & 0x1;
return tab;
}

View File

@ -1,6 +0,0 @@
print_raw_bit(number)
{
local tab = get_raw_bit(number), i = 0;
puttab_num(tab, 16);
free(tab);
}

View File

@ -17,19 +17,19 @@ puttab_str(tab)
putchar(']'); putchar(']');
} }
puttab_num(tab, size) puttab_num(tab)
{ {
local i = 0; local tmp = tab;
putchar('['); putchar('[');
loop loop
{ {
if (i == size) if ([tmp] == 0)
break; break;
putnum([tab + i]); putnum([tmp]);
i++; if ([tmp + 1] != 0)
if (i != size)
putstr(", "); putstr(", ");
tmp++;
} }
putchar(']'); putchar(']');
} }

View File

@ -9,17 +9,3 @@ tabcmp_str(tab1, tab2)
i++; i++;
} }
} }
tabcmp_num(tab1, tab2, size)
{
local i = 0;
if (size == 0)
return (0);
loop
{
if (i == size & [tab1 + i] == [tab2 + i])
return ([tab1 + i] - [tab2 + i]);
i++;
}
}

View File

@ -1,18 +0,0 @@
main()
{
local tab;
name = "get_raw_bit";
tab = get_raw_bit(1);
test_tab_num(tab, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, 16, "");
free(tab);
tab = get_raw_bit(2);
test_tab_num(tab, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, 16, "");
free(tab);
tab = get_raw_bit(0x8000);
test_tab_num(tab, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 16, "");
free(tab);
}

View File

@ -74,30 +74,11 @@ test_tab_str(value, reach_value, description)
putstr(": ERROR: "); putstr(": ERROR: ");
putstr(", "); putstr(", ");
putstr(description); putstr(description);
putstr(" [");
puttab_str(reach_value); puttab_str(reach_value);
putstr(" != "); putstr(" != ");
puttab_str(value); puttab_str(value);
} putstr("]");
else
{
putstr(": OK: ");
putstr(description);
}
wrt '\n';
}
test_tab_num(value, reach_value, size, description)
{
putstr(name);
if (tabcmp_num(value, reach_value, size))
{
putstr(": ERROR: ");
putstr(", ");
putstr(description);
puttab_num(reach_value, size);
putstr(" != ");
puttab_num(value, size);
} }
else else
{ {