jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Template function


Malcolm Dew-Jones <yf110@xxxxxxxxxxxxxx> wrote:
>>     a;---------+
>>     b;-----+   |
>>     c;--\  v   v
>>     x = ()*()+();
>> 
>
>which ends up being
>
>>     x = (c)*(b)+(a);
>
>which is equivalent to the below, but with (to my eye) a more obvious
>correspondence between the () and the values.  I'm curious how
> x = ()+()*();  would be handled, and perhaps I'm wrong anyway?

Graphically it looks like:

     a;--+
         |
     b;--)--+
         |  |
     c;--)--)--+
         |  |  |
         v  v  v
     x = ()+()*();

Or,

     PUSH a
     PUSH b
     PUSH c
     POP _TMP2              ; _TMP2=c
     POP _TMP1              ; _TMP1=b
     PUSH _TMP1 * _TMP2     ; b*c
     POP _TMP2              ; _TMP2=(b*c)
     POP _TMP1              ; _TMP1=a
     PUSH _TMP1 + _TMP2     ; a+(b*c)
     POP x                  ; x=a+(b*c)

--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]