This commit is contained in:
aiju 2011-04-26 14:32:41 +02:00
commit 62d6def842
4 changed files with 34 additions and 27 deletions

0
sys/lib/newuser Normal file → Executable file
View file

View file

@ -86,7 +86,7 @@ sys d775
+
include
+
lib
lib d775
+
log
man

View file

@ -485,38 +485,42 @@ opror(Cpu *cpu, Inst *i)
}
static void
opbts(Cpu *cpu, Inst *i)
opbt(Cpu *cpu, Inst *i)
{
ulong a, m;
int n;
int n, s;
Iarg *x;
a = ar(i->a1);
n = ar(i->a2) & 31;
n = ar(i->a2);
x = i->a1;
s = x->len*8;
if(x->tag == TMEM){
x = adup(x);
x->off += n / s;
x->off &= mask(i->alen*8);
}
a = ar(x);
n &= s-1;
m = 1<<n;
if(a & m)
cpu->reg[RFL] |= CF;
else {
cpu->reg[RFL] |= CF;
else
cpu->reg[RFL] &= ~CF;
aw(i->a1, a | m);
switch(i->op){
case OBT:
break;
case OBTS:
aw(x, a | m);
break;
case OBTR:
aw(x, a & ~m);
break;
case OBTC:
aw(x, a ^ m);
break;
}
}
static void
opbtr(Cpu *cpu, Inst *i)
{
ulong a, m;
int n;
a = ar(i->a1);
n = ar(i->a2) & 31;
m = 1<<n;
if(a & m){
cpu->reg[RFL] |= CF;
aw(i->a1, a & ~m);
} else
cpu->reg[RFL] &= ~CF;
}
static void
opbitscan(Cpu *cpu, Inst *i)
{
@ -1204,8 +1208,11 @@ static void (*exctab[NUMOP])(Cpu *cpu, Inst*) = {
[OROL] = oprol,
[OROR] = opror,
[OBTS] = opbts,
[OBTR] = opbtr,
[OBT] = opbt,
[OBTS] = opbt,
[OBTR] = opbt,
[OBTC] = opbt,
[OBSF] = opbitscan,
[OBSR] = opbitscan,

View file

@ -40,7 +40,7 @@ CMDS=cmd\
games\
SUBSYS=ape\
# /acme\
/acme\
none:VQ:
echo mk all, install, clean, nuke, release, kernels, or libs