www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/28/13:50:51

Date: Sat, 28 Jul 2001 13:50:02 -0400
Message-Id: <200107281750.NAA28754@delorie.com>
X-Authentication-Warning: delorie.com: eliz set sender to eliz AT delorie DOT com using -f
From: Eli Zaretskii <eliz AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <23f2cfa0.0107280833.779a4691@posting.google.com>
(broker_3 AT yahoo DOT com)
Subject: Re: {Traditional (_go32_dpmi_* functions)} vs { Djgpp + assembly wrapper (AS or NASM)}
References: <23f2cfa0 DOT 0107271429 DOT 4bd15544 AT posting DOT google DOT com> <2950-Sat28Jul2001102441+0300-eliz AT is DOT elta DOT co DOT il> <23f2cfa0 DOT 0107280833 DOT 779a4691 AT posting DOT google DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: broker_3 AT yahoo DOT com (ee)
> Newsgroups: comp.os.msdos.djgpp
> Date: 28 Jul 2001 09:33:07 -0700
> 
> I do not see the neccessity for
> ASSEMBLY over functions for PC architecture except for speed ?

No, assembly is not for speed in this case.  Assembly allows you to do
things that are hard or impossible in C: manipulate the stack pointer,
find the size of a function (to lock its code), issue instructions
such as CLI and STI, push and pop return addresses to/from the stack,
etc.

> If
> there a way to circumvent the situation to make it "suitable for
> production-quality code".

Yes: lock all the code and data, and you don't need to worry about
assembly too much.  I believe the FAQ suggests this approach for the
prototype code.

> I do not understand why we even learn TRADITIONAL if it crashes
> (WINDOWS mentality).

Interrupt handling is not something most programs do; thus the
``traditional'' way is what you will be facing most of the time.

> Obviously I do not fully understand "LOCKING CODE".

It means to make sure code is not paged out by the virtual memory
machinery of the OS.

> I would rather avoid TRAD and
> emphasize on assembly if that is the appropriate way of doing it.
> Someone with your knowledge and intelligence could easily give exact
> example code of where and why assemly is essential over TRAD.

It is impossible to tell all these details in a FAQ; section 18.9 is
already very large.  It includes pointers to tutorials and sample
code, precisely for this reason.

- Raw text -


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