delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/07/26/22:22:57

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1181
Path: news-dnh.mv.net!mv!news.sprintlink.net!gatech!news.uoregon.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!EU.net!Austria.EU.net!newsfeed.ACO.net!news.iif.hu!news.bme.hu!scsing.switch.ch!news.belwue.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!news.asys-h.de!asysha.asys-h.de!not-for-mail
From: ilse AT asysha DOT asys-h DOT de (Juergen Ilse)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: why no "normal" names for int(xyz) functions
Date: 26 Jul 1995 17:09:17 GMT
Organization: Advanced Systems Software GmbH
Lines: 54
References: <3v0ds9$kvp AT aurns1 DOT aur DOT alcatel DOT com>
Nntp-Posting-Host: asysha.asys-h.de
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Hallo,

John M. Klassa (klassa AT aur DOT alcatel DOT com) wrote:
: Hi-
: 
: I've been out of the PC world for a good number of years now (I do
: Unix/embedded-systems stuff at work, have an Atari ST at home and
: haven't tried to program a PC in years).  I recently got a PC & went
: straight for DJGPP, with the intent to write something.  Don't know what
: yet -- just something :-).
: 
: Anyway, what struck me right away was the number of references to things
: like:
: 
:         r.x.ax = 0x0013;
:         int86(0x10, &r, &r);
: 
: in sample code.  It seems like using the BIOS (or whatever this
: particular example happens to reflect) involves knowing specific
: function *numbers*...  In the Atari ST world, BIOS routines are done
: more or less the same way, but compilers always included bindings so
: that "normal" names could be used in place of "bios_function(12)"
: (e.g.).  That is, you'd say "SetPalette(a,b,c)" rather than
: "int(0x22,a,b,c)" (you get the idea).
: 
: Do I have a fundamental misunderstanding of what I've been reading? Is
: there more to it than this?  Any insights would be appreciated...
: 
: Thanks!
: John
: 
: -- 
: John Klassa                       Subject: @CMD help          \        /\  /\
: Alcatel Network Systems              for info...               \  /\  &  \/  \
: Raleigh, NC, USA                klassa AT aur DOT alcatel DOT com          \/  \/       \
: -------------------------------------------------------------------------------
This code makes a call to an ROM-BIOS function (in this case setting videomode)
Most of DOS and / or BIOS functions are called with Parameters in registers
instead of Parameters on (like the C-Compiler would do), so the implementor
of the library has to write a stub-function for every DOS and BIOS call. This
functions are also called via an INT instruction (this instruction works like
trap on 68000-processors), so you can't call them directly from your C-program.
Because there are many such calls, and not all are documented, there are no
such stub calls for many of the DOS and BIOS functions. To make these functions
available to the rpogrammer, someone started to write functions "int86" and
a function "int86x" that are called with the interrupt-number and pointers to
structures that will hold the values of the registers on function entry and
function return. The above code calls Interrupt 0x10 with register AH set to 0
and register al set to 0x13, this will set the videomode to Mode 0x13 (i.e.
320x200 graphicsmode with 256 colors).

hope that helps...
		cia 
				Juergen Ilse								(ilse AT asys-h DOT de)

- Raw text -


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