Contents    Page-10    Prev    Next    Page+10    Index   

Trace of Expression Algorithm


>(genarith '(* (+ a b) 3))
  1> (GENARITH (* (+ A B) 3))
    2> (GENARITH (+ A B))
      3> (GENARITH A)
        4> (GENLOAD A EAX)
   MOVL  A,EAX
        <4 (GENLOAD EAX)
      <3 (GENARITH EAX)
      3> (GENARITH B)
        4> (GENLOAD B EBX)
   MOVL  B,EBX
        <4 (GENLOAD EBX)
      <3 (GENARITH EBX)
   ADDL   EBX,EAX         ; op S,D for x86
    <2 (GENARITH EAX)     ; result in D = lhs
    2> (GENARITH 3)
      3> (GENLOAD 3 ECX)
   MOVL  3,ECX
      <3 (GENLOAD ECX)
    <2 (GENARITH ECX)
   IMULL   ECX,EAX
  <1 (GENARITH EAX)
EAX