SCRYDOSBox-XReferenceReadread_memoryAlso in MAME
read_memory
Read a few bytes of memory at an address, as hex text.
read_memory(ref, length=16)
Try it
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:OFFaddress. - 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
refresolved to, as segment and offset.
All 4 reply fields
hex(string)length(integer)ref(string)seg_off(string)
What it refuses
- A symbol the loaded table lacks (
unknown_ref), or one it holds twice (ambiguous_ref). - An offset the cpu's mode cannot address: past
0xFFFFin real mode (bad_argument). - A dump that is not the size asked for (
readback_refused).
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.
Related tools
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.