Mail Archives: djgpp/2001/07/28/13:50:51
> 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 -