|
@@ -1,8 +1,8 @@
|
|
|
#include "elea_tipi.h"
|
|
|
+#include "governo.h"
|
|
|
|
|
|
-statico carattere Accumulatore[100];
|
|
|
-statico int REG_DA = 0;
|
|
|
-statico segno REG_SEGNO_A = 0;
|
|
|
+static carattere Accumulatore[100];
|
|
|
+static segno REG_SEGNO_A = 0;
|
|
|
|
|
|
/* Da accumulatore a memoria */
|
|
|
int AoM(carattere *mem, int lun)
|
|
@@ -10,7 +10,7 @@ int AoM(carattere *mem, int lun)
|
|
|
int i;
|
|
|
int pos;
|
|
|
for (i = 0; i < lun; i++) {
|
|
|
- pos = (REG_DA + lun - (i + 1));
|
|
|
+ pos = (R.P + lun - (i + 1));
|
|
|
mem[i] = (Accumulatore[pos] & 0x7F);
|
|
|
Accumulatore[pos] = 0x80;
|
|
|
}
|
|
@@ -25,17 +25,17 @@ int MA(const carattere *mem, int lun)
|
|
|
|
|
|
for (i = 0; i < lun; i++) {
|
|
|
pos = (lun - (i + 1));
|
|
|
- Accumulatore[REG_DA + i] = (mem[pos] & 0x7F);
|
|
|
- Accumulatore[REG_DA + i] &= ~0x80;
|
|
|
+ Accumulatore[R.P + i] = (mem[pos] & 0x7F);
|
|
|
+ Accumulatore[R.P + i] &= ~0x80;
|
|
|
}
|
|
|
/* accende gA nell'ultimo carattere */
|
|
|
- Accumulatore[REG_DA + lun - 1] |= 0x80;
|
|
|
+ Accumulatore[R.P + lun - 1] |= 0x80;
|
|
|
}
|
|
|
|
|
|
int DA(const int disp)
|
|
|
{
|
|
|
if (disp < 0 || disp > 99)
|
|
|
return -1;
|
|
|
- REG_DA = disp;
|
|
|
- return REG_DA;
|
|
|
+ R.P = disp;
|
|
|
+ return R.P;
|
|
|
}
|