riscemu.types.memory_section module

class riscemu.types.memory_section.MemorySection(name: str, flags: riscemu.types.flags.MemoryFlags, size: int, base: int, owner: str, context: riscemu.types.instruction_context.InstructionContext)

Bases: ABC

name: str
flags: MemoryFlags
size: int
base: int
owner: str
context: InstructionContext
property end
abstract read(offset: int, size: int) bytearray
abstract write(offset: int, size: int, data: bytearray)
abstract read_ins(offset: int) Instruction
dump(start: int, end: Optional[int] = None, fmt: Optional[str] = None, bytes_per_row: Optional[int] = None, rows: int = 10, group: Optional[int] = None, highlight: Optional[int] = None)

Dump the section. If no end is given, the rows around start are printed and start is highlighted.

Parameters:
  • start – The address to start at

  • end – The end of the printed space

  • fmt – either hex, int, char or asm

  • bytes_per_row – the number of bytes displayed per row

  • rows – the number of rows displayed

  • group – Group this many bytes into one when displaying

  • highlight – Highlight the group containing this address

Returns:

dump_all(fmt: Optional[str] = None, bytes_per_row: Optional[int] = None, rows: int = 10, group: Optional[int] = None, highlight: Optional[int] = None)
debug_str() str
__init__(name: str, flags: MemoryFlags, size: int, base: int, owner: str, context: InstructionContext) None