Thursday, August 18, 2016

Bring Back Segments? 16-bit processor with 64-bit address space is possible!

Since currently 48-bits could address almost all contemporary information, would it be wise to develop a 16-bit processor that has two levels of segments and one level of offset?
  • Upper Segment - 16 High Bits
  • Lower Segment - 16 Middle Bits
  • Offset - 16 Low Bits
To extend it further, what about three layers of segments
  • Upper Segment - 16 High Bits
  • Middle Segment - 16 Upper Middle Bits
  • Low Segment - 16 Lower Middle Bits
  • Offset - 16 Low Bits
for a total of 64-bit address space?

Segments have natural loop of 65536 bytes, so there is no need to program a loop. An exit condition is necessary; it must jump to another segment. Multiple segment loops just require setting up the jumps properly. Even shorter loops does not need a dedicated loop command since the rest of the segment could be nop slide though this is not recommended as it is slow.

There are several types of jumps:
  • Local Jump - 16-bit jump instruction + 16-bit Add to offset
  • Low Segment Jump - 16-bit jump instruction + 16-bit Low Segment Address, Offset sets to zero
  • Mid Segment Jump
    • 16-bit jump instruction + 32-bit address, offset sets to zero
    • 16-bit jump instruction + 16-bit Mid Segment, Low Segment and Offset sets to zero
  • High Segment Jump
    • 16-bit jump instruction + 48-bit address, offset sets to zero
    • 16-bit jump instruction + 32-bit address, Low Segment and Offset sets to zero
    • 16-bit jump instruction + 16-bit address, Mid Segment, Low Segment, and Offset sets to zero
People are used to x86 memory segmentation, so they think that memory segmentation allows segments of different lengths (multiple of 16 bytes on x86, 16 bytes up to and including 65536 bytes), but in this system, all the segments are the same size - 65536 bytes. This system does not use overlapping segments so it could address more space than the x86 style of segmentation. Since every segment has the same size, paging and segmentation are not different once an expert Operating System programmer develops an Operating System for this system.

Trivia
  • A Call is a Push of Return Address into the stack and Absolute Jump to the Function.
  • A Return is an Absolute Jump using the Return Address on the Stack point by the frame pointer.
  • Goto's are jumps but jumps are not gotos.









Warning: this is only theoretical; there are no companies willing to build such a processor yet.

No comments: