delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/16/09:16:39

From: "DeHackEd" <Not DOT given AT out>
References: <350df91e DOT 820097 AT news DOT manawatu DOT gen DOT nz>
Subject: Re: Syntax of "asm" statement
Date: Mon, 16 Mar 1998 08:57:38 -0500
Lines: 51
Message-ID: <#91fpOOU9GA.243@upnetnews02.moswest.msn.net>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nope. 3 things:

1) The syntax of the asm command is:

asm ("asm commands here" : invars : outvars: clobbered registeres);
I think. I don't use the asm command.

2) The converted code would look like this:

movl $13h, %eax
int $10h

3) You can't call real mode interrupts from a protected mode program. You can
try the following and it will work, though most people prefer to use the DPMI
calls for safety. This code is a little more portable.

#include <dos.h>

void set_mode13h()
{
    union REGS regs;
    regs.x.ax = 0x13;
    int86(0x10, &regs, &regs);
}

--
"DeHackEd"

EMail address not given out due to low-life spammers.
You're the computer, you tell ME where the <censored> file is!

Michael Langton wrote in message <350df91e DOT 820097 AT news DOT manawatu DOT gen DOT nz>...
>Hello,
>I'm used to putting assembler statements into my programs using asm.
>But I can't figure out the (apparently) different syntax under djgpp.
>Here's a simple thing I would like to be able to do (this works fine
>under bc3):
>
>asm {
> mov ax, 0x0013
> int 0x10
>}
>
>TIA
>
>--
>  Michael Langton <langtons DOT NOTTHISBIT AT manawatu DOT gen DOT nz>




- Raw text -


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