mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* how to insert an asm instruction in C code and how to compile it
@ 2005-06-20 14:58 Srinivas G.
  2005-06-20 14:56 ` Paolo Ornati
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Srinivas G. @ 2005-06-20 14:58 UTC (permalink / raw)
  To: linux-kernel-Mailing-list

Dear All,

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?

Any links or Howtos are welcome.
Thanks in advance.

Regards,
Srinivas G

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-06-20 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2005-06-20 15:40 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®