1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 15:51:20 +00:00
QB64-PE/internal/help/segment.txt

30 lines
958 B
Plaintext

The memory '''segment''' is the hexadecimal byte address in relation to a segment register.
The value in a Segment register is multiplied by 16 or shifted one hexadecimal byte to the left(this adds an extra 0 to the end of the hex number). The value in the Offset register is added to it. So, the Absolute address for any combination of Segment and Offset is found using the formula:
:::AbsoluteMemoryAddress = (Segment value * 16) + Offset value
''Example:''
{{WhiteStart}} '' ''
Segment Address = F000{{text|0 ← shifted left|red}}
Offset Address = + FACE
------
FFACE or 1,047,246 '' ''
{{WhiteEnd}}
The Offset value is the position of a value after the segment address. Many pairs can be used to refer to the same memory position.
''See also:''
* [[DEF SEG]], [[DEF SEG = 0]]
* [[PEEK]], [[POKE]]
* [[VARSEG]], [[VARPTR]]
* [[SADD]]
{{PageNavigation}}