From 9e1d7b0c4561ebf7acf8af8005e14bb3f11ec0ec Mon Sep 17 00:00:00 2001 From: Test_User Date: Fri, 28 Apr 2023 23:26:27 -0400 Subject: Clearly define addressing translation, add some default segments, remove read-only restriction from IP --- cpu/access_control/addressing.txt | 8 ++++++++ cpu/registers/pointers.txt | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 cpu/access_control/addressing.txt diff --git a/cpu/access_control/addressing.txt b/cpu/access_control/addressing.txt new file mode 100644 index 0000000..babe667 --- /dev/null +++ b/cpu/access_control/addressing.txt @@ -0,0 +1,8 @@ +Case 1: Full-width address given: + Upper half is used as an index into the gdt, lower half is used as an offset within the segment + +Case 2: Less than full width address given, segment selector specified: + Fills missing bits of a full-width address with the high bits of the specified segment selector, then processes as in case 1 + +Case 3: Less than full width address given, no segment selector specified: + Same as case 2, but uses upper half of IP for instructions implicitly modifying IP, and SS0 otherwise, as the segment selector diff --git a/cpu/registers/pointers.txt b/cpu/registers/pointers.txt index e02db04..ea4d88f 100644 --- a/cpu/registers/pointers.txt +++ b/cpu/registers/pointers.txt @@ -2,10 +2,14 @@ IP (Instruction Pointer) Pointer to the current instruction being executed It is not directly affected by OR - Read-only, can be set by certain jump instructions + Can be used as a segment selector, only top half is used for this purpose SP (Stack Pointer) Pointer to the bottom of the stack (grows down) (used implicitly by push/pop instructions) BP (Base Pointer) Pointer to the top of the stack (grows down) (used implicitly by push/pop instructions) + +TODO: define n +SS0 to SS (Segment Selector n) + Half-width registers used for addressing purposes -- cgit v1.2.3