Package com.zylin.zpu.simulator.exceptions

Examples of com.zylin.zpu.simulator.exceptions.MemoryAccessException


 
  private void cpuWriteWord(int addr, int val) throws MemoryAccessException
  {
    if ((addr&0x1)!=0)
    {
      throw new MemoryAccessException();
    }
    for (int i=0; i<2; i++)
    {
      writeByte(addr+i, val>>(8*(1-i)));
    }
 
View Full Code Here


     */
  private int cpuReadWord(int addr) throws MemoryAccessException
  {
    if ((addr&0x1)!=0)
    {
      throw new MemoryAccessException();
    }
    return ((readByteInternal(addr+0)&0xff)<<8) | (readByteInternal(addr+1)&0xff);
  }
View Full Code Here

    {
      suspend();
    }
        if ((addr&0x3)!=0)
        {
            throw new MemoryAccessException();
        }
    if ((addr>=getIO())&&(addr<getIO()+IOSIZE))
    {
      ioWrite(addr, val);
    } else if ((addr>=0)&&(addr<=memory.length*4))
    {
      memory[addr/4]=val;
      validMemory[addr/4]=true;
    } else
        {
            throw new MemoryAccessException();
        }
  }
View Full Code Here

    if ((addr>=0)&&(addr<memory.length*4))
    {
      memory[addr/4]=(memory[addr/4]&(~(0xff<<((3-addr&3)*8))))|((val&0xff)<<((3-addr&3)*8));
    } else
    {
      throw new MemoryAccessException();
    }
  }
View Full Code Here

           
            case 0x200:
                return readMHz();
               
      default:
        throw new MemoryAccessException();
    }
  }
View Full Code Here

    {
      suspend();
    }
    if ((addr&0x3)!=0)
    {
      throw new MemoryAccessException();
    }
    if ((addr>=getIO())&&(addr<getIO()+IOSIZE))
    {
      return ioRead(addr);
    } else  if ((addr>=0)&&(addr<=memory.length*4))
    {
      return memory[addr/4];
    } else
        {
            throw new MemoryAccessException();
        }
  }
View Full Code Here

    if ((addr>=0)&&(addr<memory.length*4))
    {
      return readByteInternal(addr);
    } else
    {
      throw new MemoryAccessException();
    }
  }
View Full Code Here

 
  public void setPc(int pc) throws MemoryAccessException
  {
    if ((pc<VECTORBASE)||(pc>memory.length*4))
    {
      throw new MemoryAccessException();
    }
    this.pc = pc;
        touchedPc=true;
  }
View Full Code Here

            case 0x080a0038:
              return (int)(timerInterval-1-((cycles-lastTimer)%timerInterval));

           
          default:
            throw new MemoryAccessException();
        }
    }
View Full Code Here

                writeTimerSampleReg(val);
            case 0x080a000c:
                syscall.writeUART(val);
                break;
          default:
                throw new MemoryAccessException();
        }
    }
View Full Code Here

TOP

Related Classes of com.zylin.zpu.simulator.exceptions.MemoryAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.