Page 1 of 1

Segements and Offsets

Posted: Mon Aug 23, 2004 8:28 am
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>

in Directqb

Posted: Mon Aug 23, 2004 10:48 am
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

sorry

Posted: Mon Aug 23, 2004 10:49 am
by m2j *ashamed*
I forgot the close the code tag...

my bad

matt

Re: Segements and Offsets

Posted: Thu Aug 26, 2004 10:00 pm
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?

Posted: Sat Aug 28, 2004 10:40 am
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.