SCRYDOSBox-XReferenceReadread_memoryAlso in MAME

DOSBox-XRead

read_memory

Read a few bytes of memory at an address, as hex text.

read_memory(ref, length=16)

Try it

On Bricks, the game this repository builds, stopped on its play screen before any brick falls, with its symbols loaded.
Ask

Read the two bytes of the score.

Call
read_memory(ref="score", length=2)
Reply 4 of 6 fields
{
  "summary": "read_memory score: 2 bytes at 08DF:00000615: 0000",
  "seg_off": "08DF:00000615",
  "length": 2,
  "hex": "0000"
}

score is at 08DF:00000615 (seg_off) and holds 0000: no point scored yet.

The whole reply
JSON
{
  "summary": "read_memory score: 2 bytes at 08DF:00000615: 0000",
  "status": "ok",
  "ref": "score",
  "seg_off": "08DF:00000615",
  "length": 2,
  "hex": "0000"
}

Arguments

ref string, required
The address to read: a symbol or a SEG:OFF address.
length integer (>= 1, <= 128), default 16
How many bytes: 1 to 128. Left out, 16.

What comes back

hex
The bytes, two hex characters each, lowest address first.
seg_off
The address ref resolved to, as segment and offset.
All 4 reply fields
  • hex (string)
  • length (integer)
  • ref (string)
  • seg_off (string)

What it refuses

Why it works this way

The bytes come from the debugger's MEMDUMPBIN of exactly that range, and a dump of any other size is refused, never handed back shifted. For more than 128 bytes, memdump writes a file.

The contract your client receives
Text
`length` bytes (1..128) at `ref`, a symbol or `SEG:OFF` (a bare number is read as a
symbol).

Reply: `hex`, `length`, `seg_off`, `ref`; above 128 bytes use `memdump`. Needs the
machine stopped. An absent or ambiguous symbol is refused.
Tools