Added more informations on LC-2 interrupts and startup
This commit is contained in:
@@ -98,11 +98,25 @@ implicitly read by conditional branch instructions.
|
|||||||
|
|
||||||
[^lc2-condition-codes]: {{< cite-ics edition="1" chapter="5.1.7 Condition Codes" page="95" >}}
|
[^lc2-condition-codes]: {{< cite-ics edition="1" chapter="5.1.7 Condition Codes" page="95" >}}
|
||||||
|
|
||||||
|
## Startup Behavior
|
||||||
|
|
||||||
|
The ISA does not specify a default starting address or reset vector. Where the
|
||||||
|
PC is initialized when the processor powers on or resets is left entirely to
|
||||||
|
the implementation. {{< citation-needed >}}
|
||||||
|
|
||||||
## Interrupt Support
|
## Interrupt Support
|
||||||
|
|
||||||
LC-2 provides basic support for interrupts via the `RTI` (Return from
|
LC-2 provides support for vectored interrupts. When an interrupt is serviced,
|
||||||
Interrupt) instruction. When an interrupt is serviced, the processor saves the
|
the processor pushes the current PC and CC onto the stack, then reads an 8-bit
|
||||||
current status onto the stack and jumps to the interrupt handler. `RTI`
|
value from the interrupting device, called the interrupt vector (`INTV`).
|
||||||
restores the PC from the stack when the handler returns. The ISA does not
|
`INTV` is zero-extended to 16 bits and used as a memory address into the
|
||||||
specify the interrupt protocol, the bus signaling, or the acknowledgment
|
interrupt table: the value stored at that address is loaded into the PC,
|
||||||
mechanism. These details are left to the implementation.
|
transferring control to the interrupt handler.{{< citation-needed >}}
|
||||||
|
|
||||||
|
The `RTI` (Return from Interrupt) instruction reverses this process, popping
|
||||||
|
the PC and CC from the stack to resume the interrupted
|
||||||
|
program.{{< citation-needed >}}
|
||||||
|
|
||||||
|
Beyond this, the ISA does not specify the interrupt protocol in further detail:
|
||||||
|
the bus signaling and acknowledgment mechanism used to deliver `INTV` are left
|
||||||
|
to the implementation.
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ system, not the ISA itself. The ISA only defines the trap vector table at
|
|||||||
`0x0000 - 0x00FF`. Everything else, from the location of the OS to the boundary
|
`0x0000 - 0x00FF`. Everything else, from the location of the OS to the boundary
|
||||||
of userspace, is a software convention rather than a hardware requirement.
|
of userspace, is a software convention rather than a hardware requirement.
|
||||||
|
|
||||||
| Range | Purpose |
|
| Range | Purpose |
|
||||||
|:-------------------:|:-------------------------------------:|
|
|:-------------------:|:-----------------------------------------------------------------------------:|
|
||||||
| `0x0000` - `0x00FF` | Trap Vector Table[^lc2-trap] |
|
| `0x0000` - `0x00FF` | Trap Vector Table[^lc2-trap] / [Interrupt Vector Table](..#interrupt-support) |
|
||||||
| `0x0100` - `0x2FFF` | Operating System[^matt-postiff-guide] |
|
| `0x0100` - `0x2FFF` | Operating System[^matt-postiff-guide] |
|
||||||
| `0x3000` - `0xCFFF` | Userspace |
|
| `0x3000` - `0xCFFF` | Userspace |
|
||||||
| `0xD000` - `0xFFFF` | Device Registers |
|
| `0xD000` - `0xFFFF` | Device Registers |
|
||||||
|
|
||||||
[^lc2-trap]: {{< cite-ics edition="1" chapter="Appendix A.3 The Instruction Set" page="448" page-end="449" >}}
|
[^lc2-trap]: {{< cite-ics edition="1" chapter="Appendix A.3 The Instruction Set" page="448" page-end="449" >}}
|
||||||
[^matt-postiff-guide]: {{< cite-web
|
[^matt-postiff-guide]: {{< cite-web
|
||||||
|
|||||||
Reference in New Issue
Block a user