Mail Archives: djgpp/1998/08/09/11:19:40
Endlisnis wrote:
>
> Nate Eldredge wrote:
>
> > Rylan wrote:
> > Somebody correct me if I'm wrong, but a normal `int' instruction should
> > work, as long as you haven't installed a protected-mode interrupt
> > handler for that int (unlikely). Ex:
>
> main()
> {
> asm volatile ("movw $0x0013, %%ax; int $0x10" : : : "ax");
> return 0;
> }
>
> This program compiled and ran as I expected, changing the display into
> VGA
> mode. I thought you had to switch to real-mode to execute an interrupt, or
> is
> that done in this case by the DPMI server??
I believe that an interrupt is issued in real mode if there is no
protected mode handler for it. I'm not sure of this, however. The DPMI
spec might discuss it.
> And is this dangerous in any
> way?
> [Something about no stack for the interrupt?]
I'm not enough of a DPMI guru to answer this, but I haven't *heard* of
problems with it. __dpmi_int is probably safer overall, though, due to
the above issue.
> And is it OK to just put ";"
> between commands in inline asm or do you really need "\n\t"?
Yes. From the `as' docs, node "Statements":
# A "statement" ends at a newline character (`\n') or line separator
# character. (The line separator is usually `;' [...])
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -