www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/16/04:23:24

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3255
Path: news-dnh.mv.net!mv!news.sprintlink.net!europa.chnt.gtegsc.com!usenet.eel.ufl.edu!newsfeed.internetmci.com!news.fibr.net!news1.crl.com!nntp.crl.com!usenet
From: weiqigao AT crl DOT com (Weiqi Gao)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A peculiar question: Extra Segments & DJGPP...?
Date: Thu, 16 Nov 1995 04:29:38 GMT
Organization: Spectrum Healthcare Services
Lines: 54
References: <48ce37$i79 AT rznews DOT rrze DOT uni-erlangen DOT de>
Reply-To: weiqigao AT crl DOT com
Nntp-Posting-Host: crl8.crl.com
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Elmar Vogt <elmar DOT vogt AT rzmail DOT uni-erlangen DOT de> wrote:


>Hello.

>I have a pretty peculiar question, some of you may find interesting.

>I'd like to circumvene the printf() function and use the BIOS-ROM-
>routines for direct screen control. (Forfeiting all compatibility,
>I know.) Okay?

>The method of choice is then to use interrupt x10, function (dec)19
>- write a string to screen. Still on the right track?

>From C, this is usually done with int86x(19, &register_in,
>&register_out, &segments). Correct?

>x10 asks for a pointer to the string to be displayed. Fine. Alas,
>the way I understood it, its address is given by a combination of
>Extra Segment ES and Base Pointer BP, where ES is defined in segments,
>and BP in register_in.

>Say, *STRING is the string I want to display, then STRING holds the
>corresponding address- yes? Then, all I have to do is convert that value
>to a long int, divide it by 16 and pass the result to ES, then
>taking the modulo of the long int and passing this to BP. Agreed?

>Unfortunately, whenever I try to do so, I get a segment violation upon
>calling the interrupt.
>Now, where did I go astray?

>Methinks (but I know nothing about it), DJGPP doesn't care too much about
>the traditional memory segmentation. Hence, calling with some information
>about ES might actually 'surprise' it somehow, and make it falter?
>Or, if it relies on the traditional technique, the fact that the other
>values of segments are undefined might confuse it. But is there any need
>to define these values? And what might possibly be useful values...?

>Sorry if my question sounds old-fashioned, but I'm pretty new to low-
>level PC programming, and my literature was mostly about the 8086 or
>286 at most.

>Thanks for your understanding,

I don't think the pointer *STRING 's value is it's true physical
address.  It's a pointer to the process's own private virtual 4G
address space.

I'm sorry, wrong group.  Thought it was NT...  Never mind.

--
Weiqi Gao
weiqigao AT crl DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019