Difference between revisions of "84PCE:Ports:001D"
(Cleaned up the first sentence) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
'''Function:''' Stores the highest address of privileged executable code | '''Function:''' Stores the highest address of privileged executable code | ||
− | These ports contain the address of the | + | These ports contain the address (stored little-endian) of the last byte (inclusive) of privileged code. |
− | + | ||
The boot code sets this to the end of the boot code (020000), after which the OS sets it to the end of the OS (0AXXXX, varies by OS version). | The boot code sets this to the end of the boot code (020000), after which the OS sets it to the end of the OS (0AXXXX, varies by OS version). | ||
Privileged code is allowed to execute port commands (in and out) and read/write to the [[84PCE:Ports:0020|protected memory region]]. | Privileged code is allowed to execute port commands (in and out) and read/write to the [[84PCE:Ports:0020|protected memory region]]. | ||
Unprivileged code always input/read a 0 and get an nmi on output/write. | Unprivileged code always input/read a 0 and get an nmi on output/write. | ||
− | '''Note:''' | + | '''Note:''' Determining whether or not an instruction is privileged is performed during the actual execution of the instruction, not during fetching. Due to pipelining, the first byte of the next instruction has (almost always) been prefetched by this point, so the PC value checked is 1 byte after the end of the instruction. |
Latest revision as of 16:53, 10 November 2016
Synopsis
Port Number: 001D-001F
Function: Stores the highest address of privileged executable code
These ports contain the address (stored little-endian) of the last byte (inclusive) of privileged code. The boot code sets this to the end of the boot code (020000), after which the OS sets it to the end of the OS (0AXXXX, varies by OS version). Privileged code is allowed to execute port commands (in and out) and read/write to the protected memory region. Unprivileged code always input/read a 0 and get an nmi on output/write.
Note: Determining whether or not an instruction is privileged is performed during the actual execution of the instruction, not during fetching. Due to pipelining, the first byte of the next instruction has (almost always) been prefetched by this point, so the PC value checked is 1 byte after the end of the instruction.