Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The linear address for segment A000 anyone?

7 views
Skip to first unread message

Scott Tunstall

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to
Does anyone, who uses FPK Pascal, know how to get the linear address for
segment A000? (graphics screen)

regs.ax:=$13; { Standard mode 19 = 320 x 200 VGA }
realintr($10,regs)


But because we're not using segments any more I can't make DS/ ES: A000. I
have tried making EAX $A0000000 then:

mov dword ptr [eax], ..... to set the first 4 pixels to a color.


but to no avail - I get a GPF in windows 98.

Is the address relative to FS:, GS: or even CS: (can't be DS!)


Have I missed something simple ? :(

Regards,
Scott Tunstall

Winfried Rimbach-Sator

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
It should be
$A0000
(Yes, I mean 4 times '0' after the 'A')
This is because a Paragraph is only 16 Bytes in size; And the <Segment>
tells us which Paragraph to access. The Segment (= Paragraph nr.) $A000
means ($A000 * 16Bytes)Linear = Byte ($A000*$10) Linear = Byte $A0000
Linear

Hope this helps / was right.

IF you use Protected mode....forget what I said. TP/BP has a variable called
SegA000. Multiply it's value with 16 and you have the Linear address.


cod...@my-dejanews.com

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
In article <#ECny3Cs9GA.192@upnetnews03>,

"Scott Tunstall" <tuns...@email.msn.com> wrote:
> Does anyone, who uses FPK Pascal, know how to get the linear address for
> segment A000? (graphics screen)
>
> regs.ax:=$13; { Standard mode 19 = 320 x 200 VGA }
> realintr($10,regs)

Greetings, Look at the FAQ, or look at the go32 unit source code, you'll see
the dosmemput routine which writes to real mode memory with segments and
offsets, it might give you a hint ... OR read the docs, I think there is a
complete section on how to write to real mode memory ...

Carl Eric Codere
http://www-edu.gel.usherb.ca/codc01

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Pedt Scragg

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
In article <#ECny3Cs9GA.192@upnetnews03>, Scott Tunstall
<tuns...@email.msn.com> writes

>Does anyone, who uses FPK Pascal, know how to get the linear address for
>segment A000? (graphics screen)

See below

>Have I missed something simple ? :(
>

Yeah, you have.

This ng is for Borland Pascal products which are only 16 bit. The 32 bit
compilers such as FPK, TMT, GNU are covered in the ng comp.lang.pascal.misc
and posting there would probably give you an answer you can use.


--
Pedt Scragg <newsm...@pedt.demon.co.uk>

Never curse the Crocodile's mother before crossing the river

Scott Tunstall

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
>It should be
>$A0000
>(Yes, I mean 4 times '0' after the 'A')


Yeah, I know my segments and offsets, thanx! ;)

But.. I still get a GPF!


>This is because a Paragraph is only 16 Bytes in size; And the <Segment>
>tells us which Paragraph to access. The Segment (= Paragraph nr.) $A000
>means ($A000 * 16Bytes)Linear = Byte ($A000*$10) Linear = Byte $A0000
>Linear
>
>Hope this helps / was right.
>
>IF you use Protected mode....forget what I said. TP/BP has a variable
called
>SegA000. Multiply it's value with 16 and you have the Linear address.
>

Yeah, I'm converting a 16 bit TP program over to FPK 32 bit and the only
problem was getting A000
-> linear address.

>
>

Scott Tunstall

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to
>Greetings, Look at the FAQ, or look at the go32 unit source code, you'll
see
>the dosmemput routine which writes to real mode memory with segments and
>offsets, it might give you a hint ... OR read the docs, I think there is a
>complete section on how to write to real mode memory ...
>


Yeah, I did that and it was so simple I deserve a smack with a kipper -
especially for posting to a borland only newsgroup ;)

For those interested, the VGA screen begins at linear address $A0000. And it
really is just a simple case of MOV EAX, $A0000 then MOV [EAX], .... to
write to the top left etc.

Thanks for your help folks
Scott

Scott Tunstall

unread,
Jul 16, 1998, 3:00:00 AM7/16/98
to

Scott Tunstall wrote in message ...

>>It should be
>>$A0000
>>(Yes, I mean 4 times '0' after the 'A')
>
>
>Yeah, I know my segments and offsets, thanx! ;)
>
>But.. I still get a GPF!


But when I return to DOS.... it works!!!!!!!! Thanks Winfried :)


>
>
>>This is because a Paragraph is only 16 Bytes in size; And the <Segment>
>>tells us which Paragraph to access. The Segment (= Paragraph nr.) $A000
>>means ($A000 * 16Bytes)Linear = Byte ($A000*$10) Linear = Byte $A0000
>>Linear
>>
>>Hope this helps / was right.
>>

Yep. I should hang my head in shame for moving over to Visual C++ and
forgetting the grass roots stuff!!

Thanks to all who wrote.

0 new messages