[Linux-ia64] Newbie questions

From: CH Gowri Kumar <gkumar_at_csa.iisc.ernet.in>
Date: 2002-11-09 05:51:40
hello all,
I am a post-graduate student trying to write a JIT compiler for .NET CLR
on Linux,IA-64.

I have some queries related to IA-64 assembly programming

I plan to write the JIT this way:
I generate the native code directly (instead of assembly language and
then using assembler)for a particular method and jump to the address
of the starting memory location where I have generated the native code. I
have written a small program to check whether such a thing is feasible, 
which is as follows:

#include<unistd.h>
int main()
{
  __asm__("
      mov r32=18
      mov r15=1025
      break 0x100000"
  );
}

I wrote the above program and compiled it and found the appropriate codes
for the instructions using objdump -d and wrote the following program

char sc[] ="\x0a"
           "\x10"
           "\x00"
           "\x18\x00\x21\x00\x92\x00\x00\x42\xe0\x11\x00\x20\x84\x0a";
       main()
       {
         void (*fp)(void);
         fp = (void*)sc;
         fp();
      }

But this program on execution gives me the error:
"Illegal instruction (core dumped)"
(A similar program for IA-32 worked well.)

I couldn't figure out what could be the problem.
I also tried using "br instruction" approach instead of the function
pointer approach, but couldn't succeed.

Can anyone explain why it is failing or atleast give me pointers where to
look for?

Thanks in advance.
Gowri Kumar
Received on Fri Nov 08 10:51:58 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:10 EST