Skip to content

Instantly share code, notes, and snippets.

@segrax
Last active August 29, 2015 14:12
Show Gist options
  • Save segrax/006e04be77b36382f776 to your computer and use it in GitHub Desktop.
Save segrax/006e04be77b36382f776 to your computer and use it in GitHub Desktop.
Memory Segment Calculations
To calculate the segment of a memory address,
Memory Address >> 4 = Segment
-----------------------------
0xFFFF0 >> 4 = 0xFFFF
To calculate the memory address from a segment
Segment << 4 = Memory Address
-----------------------------
0xFFFF >> 4 = 0xFFFF0
===============================================
Each segment begins on a Paragraph Boundary (which is an address that is evenly divisible by 16).
Segment MemoryAddress
0x0000 = 0x00000
0x0001 = 0x00010
0x0002 = 0x00020
0x0003 = 0x00030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment