Re: win32 or native NT windows API



"randyhyde@xxxxxxxxxxxxx" wrote:
Herbert Kleebauer wrote:

The call of OS functions is done by an INT or SYSCALL and not by
a call to a function in a DLL.

Says who?
BTW, ever hear of call gates?

Didn't you write an assembler? A Windows DLL call is an (indirect)
near call. To access a call gate, you need a call instruction which
provides a segment selector. The call gate specified by this selector
specifies the target code segment AND the entry point (the address
specified in the call instruction is ignored). And it doesn't make
much sense to use call gates in an OS which doesn't use segmentation
at all.


Any code in the DLL is executed in
the context of the running program and there is no difference whether
you call this code in the DLL or you include the source of this
code in your own program.

And your point is?

The point is, that I don't need any help from the OS for code which
is executed in user mode. Code which is executed in user mode can
be written by the user himself. And especially for learning and
understanding user code should be written by the user.

And this is the reason why the old DOS
int21 (or the Linux int80) interface is much more appropriate for
learning assembly programming than the DLL calls in Windows.

Why does the OS calling mechanism have *anything* to do with assembly
programming?

OS calling mechanism has *nothing* to do with assembly programming.
But in a "normal" Windows assembler program the user never calls the OS,
he just calls other user code loaded from a DLL (by a near call) which
then itself calls the OS. If the user would call the OS, then he somewhere
in his source code had to write the INT or SYCALL instruction (or, if you
like use a call gate).


Indeed, by your own argument DOS calls are not true OS
calls because the code executes in the same environment as the user
program.

If the processor is in real mode, then the user code also has
the right to access all hardware. And then it is the best to
ignore the OS as far as possible (for understanding the system,
not for writing applications). So don't use any output routine
of the OS but write directly to the screen buffer.


It makes no difference whether you using the INT instruction
or call the code directly in memory (e.g., by obtaining the address
from the interrupt vector table). Indeed, many DOS programs include
their own INT handlers, hence such code is part of the user program
anyway.

If the processor is in V86 mode, you have to call the OS. The interrupt
vectors you see in your V86 program are not the ones which are executed
when a real interrupt occurs (nothing but a "virtual reality").

Your argument is *seriously* flawed here.

Don't think so.
.



Relevant Pages

  • Re: How to compile the following into a DLL?
    ... Jim Carlock wrote: ... > COM or ActiveX DLL. ... > the VB6 IDE. ... the module export thing depends on the assembler and linker used, ...
    (comp.lang.asm.x86)
  • Re: Perplexing Problem - Need Help
    ... Is the DLL referred to above the VB DLL mentioned elsewhere or part of the ... 3rd party scanner code or Oracle API? ... degug log (assuming that the app has been started with the /D switch). ... I could, in fact, see inside a C or assembler ...
    (microsoft.public.vb.general.discussion)
  • Re: Perplexing Problem - Need Help
    ... Is the DLL referred to above the VB DLL mentioned elsewhere or part of ... the 3rd party scanner code or Oracle API? ... I could, in fact, see inside a C or assembler ... If the app is closed normally after one ...
    (microsoft.public.vb.general.discussion)
  • Re: How to compile the following into a DLL?
    ... what might give it the ability to register itself in the registry. ... I've created a small ActiveX dll using VB and the file is only ... the module export thing depends on the assembler and linker used, ... use a definitions file to declare them but with the right tools ...
    (comp.lang.asm.x86)
  • Re: win32 or native NT windows API
    ... Didn't you write an assembler? ... provides a segment selector. ... The call gate specified by this selector ... use such calls to make system calls, no INT or SYSENTER or SYSCALL ...
    (alt.lang.asm)