[Yhc] examining yhc bytecode
Neil Mitchell
ndmitchell at gmail.com
Thu Sep 28 05:14:12 EDT 2006
Hi Kartik,
yhc -help gives you:
-bcodecompile show B code after compile (default=off)
-bcodemem show B code after heap usage analysis (default=off)
-bcodeflatten show B code after flattening (default=off)
-bcoderel show B code after converting to relative jumps
(default=off)
Running yhc Main.hs -bcodecompile
Compiling Main ( Main.hs )
------ BCode after compilation:
FUN Main;main{193}(0/0) []
STACK 3
{
PUSH_CONST 0 1 <[] | {}>
PUSH_CONST 1 2 <[] | {}>
PUSH 1 3 <["200"] | {"200"}>
MK_AP 2 1 3 <[] | {}>
APPLY 1 2 <[] | {}>
PUSH 1 3 <["200"] | {"200"}>
MK_AP 3 1 3 <[] | {}>
MK_AP 4 2 2 <[] | {}>
EVAL 2 <[] | {}>
SLIDE 1 1 <[] | {}>
RETURN 1 <[] | {}>
}
FLAGS []
---- ConstTable ---------------
0 CAF Prelude;Prelude.Num.Prelude.Integer{202}
1 INTEGER 42
2 FUN Prelude;fromInteger{123}
3 FUN Prelude;Prelude.Num.Prelude.Show{201}
4 FUN Prelude;print{50}
-------------------------------
The bytecode library should work, I'll raise a bug.
Thanks
Neil
On 9/28/06, Kartik Vaddadi <itskartik at iitb.ac.in> wrote:
> Hello,
> I want to examine yhc bytecode, but Robert Dockins's library
> (http://www.eecs.tufts.edu/~rdocki01/yhc-bytecode.html) complains of a
> "Bad version". Are there any alternatives, other than doing it manually
> using a hex editor? Thanks.
>
> --
> Kartik Vaddadi.
>
> Home: www.cse.iitb.ac.in/~kart
> Blogs: kartik-log.blogspot.com, kartik-rlog.blogspot.com
> Alternate mail ID: kartik.vad at gmail.com
>
> "50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)
>
> _______________________________________________
> Yhc mailing list
> Yhc at haskell.org
> http://www.haskell.org/mailman/listinfo/yhc
>
More information about the Yhc
mailing list