gumnut_simulator.exceptions

Module Contents

exception gumnut_simulator.exceptions.Error(expression, message)

Bases: Exception

Base class for all exceptions.

This is the base class for all exceptions raised within the GumnutSimulator context. To provide sufficient user feedback the cause expression of the exception and a somewhat helpfull message is passed to the constructor.

Parameters
  • expression – A string containing the expression which caused the exception to be raised.

  • message – A string containing some more information what could raise such an exception.

__repr__(self)

Return repr(self).

as_dict(self)
exception gumnut_simulator.exceptions.InvalidPCValue(expression, message)

Bases: Error

Get’s raised when the programm counter (PC) has an invalid value. This is the case for any value less than 0 and greater than 4095.

exception gumnut_simulator.exceptions.InstructionMemorySizeExceeded(expression, message)

Bases: Error

Get’s raised when trying to upload more data into the instruction memory than it can hold.

exception gumnut_simulator.exceptions.DataMemorySizeExceeded(expression, message)

Bases: Error

Get’s raised when trying to upload more data into the data memory than it can hold.

exception gumnut_simulator.exceptions.DataMemoryAccessViolation(expression, message)

Bases: Error

Get’s raised when trying to access data from the data memory which isn’t accessible.

exception gumnut_simulator.exceptions.InvalidInstruction(expression, message)

Bases: Error

Get’s raised when an unknown or invalid instruction is encountered.

exception gumnut_simulator.exceptions.EmptyReturnStack(expression, message)

Bases: Error

Get’s raised when trying to return from a subroutine although the return address stack is empty.

exception gumnut_simulator.exceptions.ReturnAddressStackOverflow(expression, message)

Bases: Error

Get’s raised when trying jump into a subroutine although the return address stack is already full.