www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/15/16:05:39

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3249
Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!news.kei.com!simtel!swidir.switch.ch!swsbe6.switch.ch!scsing.switch.ch!news.belwue.de!news.uni-stuttgart.de!uni-regensburg.de!lrz-muenchen.de!faui0n.informatik.uni-erlangen.de!uni-erlangen.de!rznews.rrze.uni-erlangen.de!news
From: Elmar Vogt <elmar DOT vogt AT rzmail DOT uni-erlangen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: A peculiar question: Extra Segments & DJGPP...?
Date: 15 Nov 1995 10:06:31 GMT
Organization: LUR, University of Erlangen
Lines: 59
Nntp-Posting-Host: faust207.lstm.uni-erlangen.de
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

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,

   Elmar

--
 -----------------------------------------------------------------------
|Elmar Vogt                        |I am a man of the sword and the word|
|Dept. for Environmental Processing|devoted to an antic concept of love |
|Technology and Recycling,         |and devotion, brought down to earth |
|University of Erlangen, Germany   |by powder, and lead,                |
|----------------------------------|and a king's dishonor.              |
|elmar DOT vogt AT rzmail DOT uni-erlangen DOT de |        (Sir Walter Scott: Ivanhoe) |
|vogt AT nt DOT e-technik DOT uni-erlangen DOT de  \-----------------------------------|
|http://www.rrze.uni-erlangen.de/~iwur08/                               |
 -----------------------------------------------------------------------|
| SCA: Agilmar Martell von Sevelingen, Shire of Turmstadt, Drachenwald  |
 -----------------------------------------------------------------------


- Raw text -


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