- handle INTFLY (interrupt on the fly) command
- hanlde set/clear carry - handle shl, shr (shift left and rigth) and xor operators
This commit is contained in:
parent
884898e332
commit
4b8e2f7002
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr53cxxx.c,v 1.9 2002/04/20 20:56:25 bouyer Exp $ */
|
||||
/* $NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995,1999 Michael L. Hitch
|
||||
@ -61,6 +61,7 @@ void f_jump (void);
|
||||
void f_call (void);
|
||||
void f_return (void);
|
||||
void f_int (void);
|
||||
void f_intfly (void);
|
||||
void f_select (void);
|
||||
void f_reselect (void);
|
||||
void f_wait (void);
|
||||
@ -88,6 +89,7 @@ struct {
|
||||
{"CALL", f_call},
|
||||
{"RETURN", f_return},
|
||||
{"INT", f_int},
|
||||
{"INTFLY", f_intfly},
|
||||
{"SELECT", f_select},
|
||||
{"RESELECT", f_reselect},
|
||||
{"WAIT", f_wait},
|
||||
@ -412,7 +414,7 @@ main (int argc, char *argv[])
|
||||
if (outfp) {
|
||||
time_t cur_time;
|
||||
|
||||
fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.9 2002/04/20 20:56:25 bouyer Exp $\t*/\n");
|
||||
fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $\t*/\n");
|
||||
fprintf(outfp, "/*\n");
|
||||
fprintf(outfp, " *\tDO NOT EDIT - this file is automatically generated.\n");
|
||||
time(&cur_time);
|
||||
@ -997,6 +999,11 @@ void f_int (void)
|
||||
transfer (0x98000000, 2);
|
||||
}
|
||||
|
||||
void f_intfly (void)
|
||||
{
|
||||
transfer (0x98100000, 2);
|
||||
}
|
||||
|
||||
void f_select (void)
|
||||
{
|
||||
int t = tokenix;
|
||||
@ -1270,8 +1277,12 @@ void set_clear (u_int32_t code)
|
||||
inst0 |= 0x0200;
|
||||
++i;
|
||||
}
|
||||
else if (reserved ("carry", i)) {
|
||||
inst0 |= 0x0400;
|
||||
++i;
|
||||
}
|
||||
else
|
||||
errout ("Expected ATN, ACK, or TARGET");
|
||||
errout ("Expected ATN, ACK, TARGET or CARRY");
|
||||
need_and = 1;
|
||||
}
|
||||
store_inst ();
|
||||
@ -1323,8 +1334,14 @@ void register_write ()
|
||||
|
||||
if (reserved ("to", tokenix+1))
|
||||
op = 0;
|
||||
else if (reserved ("shl", tokenix+1))
|
||||
op = 1;
|
||||
else if (reserved ("shr", tokenix+1))
|
||||
op = 5;
|
||||
else if (tokens[tokenix+1].type == '|')
|
||||
op = 2;
|
||||
else if (reserved ("xor", tokenix+1))
|
||||
op = 3;
|
||||
else if (tokens[tokenix+1].type == '&')
|
||||
op = 4;
|
||||
else if (tokens[tokenix+1].type == '+')
|
||||
@ -1333,8 +1350,16 @@ void register_write ()
|
||||
op = 8;
|
||||
else
|
||||
errout ("Unknown register operator");
|
||||
if (op && reserved ("to", tokenix+3) == 0)
|
||||
errout ("Register command expected TO");
|
||||
switch (op) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
if (reserved ("to", tokenix+3) == 0)
|
||||
errout ("Register command expected TO");
|
||||
default:
|
||||
}
|
||||
reg = CheckRegister (tokenix);
|
||||
if (reg < 0) { /* Not register, must be data */
|
||||
data = evaluate (tokenix);
|
||||
@ -1347,24 +1372,45 @@ void register_write ()
|
||||
#if 0
|
||||
fprintf (listfp, "Move data to register: %02x %d\n", data, reg);
|
||||
#endif
|
||||
}
|
||||
else if (op) { /* A register read/write operator */
|
||||
data = evaluate (tokenix+2);
|
||||
if (tokenix+5 < ntokens) {
|
||||
if (!reserved("with", tokenix+5) ||
|
||||
!reserved("carry", tokenix+6)) {
|
||||
errout("Expected 'WITH CARRY'");
|
||||
} else if (op != 6) {
|
||||
errout("'WITH CARRY' only valide with '+'");
|
||||
} else if (op) {
|
||||
switch (op) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
inst0 = 0;
|
||||
/* A register read/write operator */
|
||||
if (reserved("sfbr", tokenix+2)) {
|
||||
if (arch < ARCH825)
|
||||
errout("wrong arch for add with SFBR");
|
||||
if (op == 8)
|
||||
errout("can't substract SFBR");
|
||||
inst0 |= 0x00800000;
|
||||
data = 0;
|
||||
} else
|
||||
data = evaluate (tokenix+2);
|
||||
if (tokenix+5 < ntokens) {
|
||||
if (!reserved("with", tokenix+5) ||
|
||||
!reserved("carry", tokenix+6)) {
|
||||
errout("Expected 'WITH CARRY'");
|
||||
} else if (op != 6) {
|
||||
errout("'WITH CARRY' only valide "
|
||||
"with '+'");
|
||||
}
|
||||
op = 7;
|
||||
}
|
||||
op = 7;
|
||||
if (op == 8) {
|
||||
data = -data;
|
||||
op = 6;
|
||||
}
|
||||
inst0 |= (data & 0xff) << 8;
|
||||
data = CheckRegister (tokenix+4);
|
||||
break;
|
||||
default:
|
||||
data = CheckRegister (tokenix+2);
|
||||
break;
|
||||
}
|
||||
if (op == 8) {
|
||||
data = -data;
|
||||
op = 6;
|
||||
}
|
||||
inst0 = (data & 0xff) << 8;
|
||||
data = CheckRegister (tokenix+4);
|
||||
if (data < 0)
|
||||
errout ("Expected register");
|
||||
if (reg != data && reg != 8 && data != 8)
|
||||
@ -1389,8 +1435,7 @@ fprintf (listfp, "Move register to SFBR: %02x %d %d\n", inst0 >> 8, op, reg);
|
||||
inst0 |= 0x70000000 | (op << 24) | (reg << 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { /* register to register */
|
||||
} else { /* register to register */
|
||||
data = CheckRegister (tokenix+2);
|
||||
if (data < 0)
|
||||
errout ("Expected register");
|
||||
|
Loading…
Reference in New Issue
Block a user