URL
https://opencores.org/ocsvn/1664/1664/trunk
[/] [1664/] [trunk/] [c/] [cpu_1664/] [cpu_1664_umm_tradui_desloca.c] - Blame information for rev 2
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
2 |
mrdmkg |
#include "cpu_1664.h"
|
2 |
|
|
|
3 |
|
|
cpu_1664_sinia_t cpu_1664_umm_tradui_desloca(struct cpu_1664 *cpu, cpu_1664_sinia_t desloca_esije)
|
4 |
|
|
{
|
5 |
|
|
cpu_1664_sinia_t *mapa=(cpu_1664_sinia_t *)(cpu->lista_imaje->datos+cpu->umm_memoria[cpu_1664_umm_desloca_usor_mapa]);
|
6 |
|
|
cpu_1664_sinia_t desloca_real=-1;
|
7 |
|
|
|
8 |
|
|
if((cpu->umm_memoria[cpu_1664_umm_desloca_usor_mapa]+sizeof(cpu_1664_sinia_t)*3)>=cpu->lista_imaje->capasia)
|
9 |
|
|
{
|
10 |
|
|
cadena__f((P)scrive_stdout, "\neseta usor : memoria asede sin mapa usor [%.*x] %*.x -> IP %.*x\n",sizeof(cpu_1664_sinia_t)*2,desloca_esije,sizeof(cpu_1664_sinia_t)*2,mapa,sizeof(cpu_1664_sinia_t)*2,cpu->sinia[cpu_1664_sinia_IP]);
|
11 |
|
|
cpu_1664_eseta(cpu, cpu_1664_eseta_umm_limite);
|
12 |
|
|
return -1;
|
13 |
|
|
}
|
14 |
|
|
|
15 |
|
|
while(*mapa!=0)
|
16 |
|
|
{
|
17 |
|
|
cpu_1664_sinia_t cuantia=(mapa[cpu_1664_umm_usor_mapa_cuantia]&(((cpu_1664_sinia_t)(-1))-0x07));
|
18 |
|
|
|
19 |
|
|
if((desloca_esije>=mapa[cpu_1664_umm_usor_mapa_desloca_usor])&&(desloca_esije<(mapa[cpu_1664_umm_usor_mapa_desloca_usor]+cuantia)))
|
20 |
|
|
{
|
21 |
|
|
desloca_real=desloca_esije-mapa[cpu_1664_umm_usor_mapa_desloca_usor]+mapa[cpu_1664_umm_usor_mapa_desloca_real];
|
22 |
|
|
break;
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
mapa+=3;
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
if(*mapa==0)
|
29 |
|
|
{
|
30 |
|
|
cadena__f((P)scrive_stdout, "\neseta usor : memoria asede sin mapa usor desloca esije [%.*x] -> IP %.*x\n",sizeof(cpu_1664_sinia_t)*2,desloca_esije,sizeof(cpu_1664_sinia_t)*2,cpu->sinia[cpu_1664_sinia_IP]);
|
31 |
|
|
cpu_1664_eseta(cpu, cpu_1664_eseta_umm_limite);
|
32 |
|
|
return -1;
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
return desloca_real;
|
36 |
|
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.