All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mads Martin Joergensen <mmj@mmj.dk>
To: "Srinivas G." <srinivasg@esntechnologies.co.in>
Cc: linux-kernel-Mailing-list <linux-kernel@vger.kernel.org>
Subject: Re: how to insert an asm instruction in C code and how to compile it
Date: Mon, 20 Jun 2005 16:57:52 +0200	[thread overview]
Message-ID: <20050620145752.GB27543@mmj.dk> (raw)
In-Reply-To: <4EE0CBA31942E547B99B3D4BFAB348115AB385@mail.esn.co.in>

* Srinivas G. <srinivasg@esntechnologies.co.in> [Jun 20. 2005 16:52]:
> I am very sorry for asking such a silly question here.
> 
> I have small doubt about ASM code in a C program. Actually I want to
> insert some asm instructions in a C program and after that I want to
> compile the C program. 
> 
> I want to include the following code in a simple C program and compile
> it.
> 
> #define printf DbgPrint
> 
> int main()
> {
> 	printf("Hello world program!\n");
> 	return 0;
> }
> void DbgPrint(char* str,...)
> {
> 	volatile USHORT i = 0;
>     	volatile UCHAR sch;
> 	while(str[i])
> 	{
> 		sch = str[i];
> 		i ++;
> 		asm mov ah,0x0E;
> 		asm mov al,sch;
> 		
> 		asm cmp	al,0ah 
> 		asm jne	test
> 		asm mov	al,0dh     //; new line
> 		asm mov	bx,07h
> 		asm int	10h
> 		asm mov	al,0ah
> test:
> 		asm mov bx,0x07
> 		asm int 0x10
> 	}
> }
> 
> Please let me know how to do it?

http://www.int80h.org/

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                -- A. P. J.

  parent reply	other threads:[~2005-06-20 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 14:58 how to insert an asm instruction in C code and how to compile it Srinivas G.
2005-06-20 14:56 ` Paolo Ornati
2005-06-20 14:57 ` Mads Martin Joergensen [this message]
2005-06-20 15:40 ` Richard B. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050620145752.GB27543@mmj.dk \
    --to=mmj@mmj.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivasg@esntechnologies.co.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.