SCRYDOSBox-XReferenceHardwarea20

DOSBox-XHardware

a20

Read or set the A20 line, which decides whether addresses past 1 MB wrap around to 0.

a20(method)

Try it

On Bricks, the game this repository builds, stopped on its play screen.
Ask

Is the A20 line on?

Call
a20(method="read")
Reply 2 of 3 fields
{
  "summary": "a20 read: the A20 gate is on",
  "enabled": true
}

enabled is true: the A20 line is on, so addresses past 1 MB do not wrap to 0.

The whole reply
JSON
{
  "summary": "a20 read: the A20 gate is on",
  "status": "ok",
  "enabled": true
}

The three methods

method what it does
read Says whether the line is on. It writes nothing.
on Turns the line on and reads it back. That is a write: the session is marked altered.
off Turns the line off, the same way.

Arguments

method one of "read", "on", "off", required
read, on or off, as above.

What comes back

enabled
true when the A20 line is on.
All 1 reply fields
  • enabled (boolean)

What it refuses

Why it works this way

A DOS kernel loaded into the high memory area turns the line on for itself at each INT 21h. So a line set off may be undone at the program's next DOS call.

The contract your client receives
Text
The A20 gate, which decides whether memory past 1 MB wraps to 0. Needs the machine
stopped.

`method`: one of `read`, `on`, `off`. The last two mark the session `altered` and read the
gate back.
Reply: `enabled`.

Refused: a build with no `A20` command (`no_channel`); a gate that does not read back as set
(`readback_refused`); a running guest
(`not_stopped`); an answer of another shape (`unexpected_answer`).

Reference: REFERENCE.md, The machine's hardware.
Tools