[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Jilc-dev] Problem
From: |
Gaurav Vaish |
Subject: |
Re: [Jilc-dev] Problem |
Date: |
Fri, 22 Feb 2002 06:07:09 +0530 |
----- Original Message -----
From: "Gopal.V" <address@hidden>
To: <address@hidden>
Sent: Friday, February 22, 2002 02:55
Subject: Re: [Jilc-dev] Problem
: || OLD CODE
: || -------
: || printf("%d;code offset ",
: || NEW CODE
: || ---------
: || printf("\t %s;code offset ", insn_offset + \
Damn yaar, I put it "%s" instead of "%d".
But now that I look at your code for LABEL more closely, I find the
following:
(Int16)(code[start+1]<<8|code[start+2])
which I changed it to:
( (Int16)code[start + 1]) << 0x08 | ((Int16)code[start + 2]) )
// and was getting wrong label number in if_icmplt
since I thought that bye should first be converted to Int16 before being
bit-ORed. For your code, (code[start + 1] << 8) will only zeros since (*code) is
a byte and what one will get after left-shifting 8-bits is all-zeroes.
So, what's the point keeping it? I guess, you got my argument.
Also, I have made another change in your code:
For case "II", ie, two parameter case:
original:
printf("%d",code[start+1]<<8|code[start+2]);
new:
printf(" %d %d", (code[start + 1]), (code[start + 2]));
which I think is correct change, since the two parameters should be printed
separately. That's why using the original version, we get "iinc 257" while the
correct code should be "iinc 1 1" which is obtained by the newer version.
Cheers,
Gaurav Vaish
http://home.iitk.ac.in/student/gvaish
http://calendar.yahoo.com/mastergaurav
-----------------------