Segements and Offsets

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Segements and Offsets

Post by {Nathan} »

Ok, people. Lets get down to bissinus. ( :? ) ok, i wanna no more about segments and offsets. i no that A000 is vga, i n how 2 get to varibles and stuff, but HOW THE HECK do i use them in direct qb? i have always been perplexed at this, so please help me out! <b>thanks all!</b>
m2j

in Directqb

Post by m2j »

In QB when you use segments and offsets to access variables you do

Code: Select all

dim variable as string * 1

def seg = varseg(variable)
     poke varptr(variable), 90                  'I think thats a Z
def seg

so varseg(variable) is the segment of the variable and varptr(variable) is the pointer of the variable.

In directQB whenever the sub asks for the segment and offset it's usually talking about arrays, so you just type varseg(array(0)) where it wants the segment and varptr(array(0))  where it wants the offset.

matt
m2j *ashamed*

sorry

Post by m2j *ashamed* »

I forgot the close the code tag...

my bad

matt
WDude

Re: Segements and Offsets

Post by WDude »

Nathan1993 wrote:Ok, people. Lets get down to bissinus. ( :? ) ok, i wanna no more about segments and offsets. i no that A000 is vga, i n how 2 get to varibles and stuff, but HOW THE HECK do i use them in direct qb? i have always been perplexed at this, so please help me out! <b>thanks all!</b>
Nathan, can you tell me more what you want to do? I've had a lot of experience using DQB, and I am assuming you want to know the segment and offset of EMS layers. I guess you want to use PEEK and POKE through DQB-made layers right?
Neo Deus Ex Machina

Post by Neo Deus Ex Machina »

The DQB layers usually are in EMS memory, which means you have to have this:
- The DirectQB EMS Handle
- EMS Routines

There are cool EMS routines in NeoLib v1.6 (with code, so you can see how they work): http://qbnz.com/pages/uploads/upload/NeoLib16.zip.
Post Reply