Added more informations on LC-2 interrupts and startup

This commit is contained in:
2026-08-31 16:37:38 +02:00
parent 9a85d3193f
commit cecaf1cd31
2 changed files with 26 additions and 12 deletions
+20 -6
View File
@@ -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.
+2 -2
View File
@@ -25,8 +25,8 @@ system, not the ISA itself. The ISA only defines the trap vector table at
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 |