avrora.sim.mcu
Class ReprogrammableCodeSegment
java.lang.Object
avrora.sim.Segment
avrora.sim.CodeSegment
avrora.sim.mcu.ReprogrammableCodeSegment
- public class ReprogrammableCodeSegment
- extends CodeSegment
The ReprogrammableCodeSegment
class represents a flash segment that stores code. This segment
can be updated during execution. It supports probing instructions in the flash segment and updating them.
This implementation uses special instructions that automatically disassemble themselves from the machine
code representation when they are accessed, allowing dynamic update and execution of machine code.
Constructor Summary |
ReprogrammableCodeSegment(java.lang.String name,
int size,
BaseInterpreter bi,
Segment.ErrorReporter er,
int pagesize)
The constructor for the ReprogrammableCodeSegment creates a new instance with the specified
name, with the specified size, connected to the specified microcontroller, with the given page size. |
Method Summary |
protected void |
resetBuffer()
The resetBuffer() method resets the temporary buffer used for the SPM instruction
to its default value. |
void |
update()
The update() method is called by the interpreter when the program executes an instruction
that updates the program memory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReprogrammableCodeSegment
public ReprogrammableCodeSegment(java.lang.String name,
int size,
BaseInterpreter bi,
Segment.ErrorReporter er,
int pagesize)
- The constructor for the
ReprogrammableCodeSegment
creates a new instance with the specified
name, with the specified size, connected to the specified microcontroller, with the given page size.
- Parameters:
name
- the name of the segment as a stringsize
- the size of the segment in bytesbi
- the the interpreter the code segment is attached toer
- the error reporter consulted for out of bounds accessespagesize
- the size of the page offset field of an address into the flash
update
public void update()
- The
update()
method is called by the interpreter when the program executes an instruction
that updates the program memory. For example, the SPM instruction.
- Overrides:
update
in class CodeSegment
resetBuffer
protected void resetBuffer()
- The
resetBuffer()
method resets the temporary buffer used for the SPM instruction
to its default value.