Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #103834

Re: compile "a = 2*f+(d-g/3)*(9-i)"

From BartC <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: compile "a = 2*f+(d-g/3)*(9-i)"
Date 2017-02-13 20:10 +0000
Organization A noiseless patient Spider
Message-ID <o7t3ne$6e2$1@dont-email.me> (permalink)
References <ce233d83-2f17-4dad-8f38-9d0aa0fde624@googlegroups.com> <720c394b-bdb5-4b2d-8d51-38185ddd9d8f@googlegroups.com>

Show all headers | View raw


On 13/02/2017 19:44, fir wrote:
> W dniu poniedziałek, 13 lutego 2017 20:43:15 UTC+1 użytkownik fir napisał:
>> if i like to write compiler i should probably start with compiling such as above
>> (assume a f d g i are 32bit int (or float dont matter) registers and i need to produce classical simple wirtual assembly for that
>>
>> like
>>
>> mov tmp1 2
>> mov tmp2 f
>> mul tmp1 tmp2
>>
>> mov tmp3 d
>> mov tmp4 g
>> mov tmp5 3
>> div tmp4 tmp3
>> sub tmp3 tmp4
>>
>> etc.. how to do that EASILY (easy and short) ?
>
> ps some pseudocode would be much welcome
>

https://rosettacode.org/wiki/Compiler

Look at the links to the tasks (the different parts of a compiler). 
There is sample code in various languages. Including C.

-- 
bartc

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 11:43 -0800
  Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 11:44 -0800
    Re: compile "a = 2*f+(d-g/3)*(9-i)" BartC <bc@freeuk.com> - 2017-02-13 20:10 +0000
      Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 12:36 -0800
        Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 13:31 -0800
        Re: compile "a = 2*f+(d-g/3)*(9-i)" BartC <bc@freeuk.com> - 2017-02-13 23:21 +0000
          Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-14 00:27 -0800
  Re: compile "a = 2*f+(d-g/3)*(9-i)" supercat@casperkitty.com - 2017-02-13 13:29 -0800
    Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 13:44 -0800
      Re: compile "a = 2*f+(d-g/3)*(9-i)" supercat@casperkitty.com - 2017-02-13 14:01 -0800
        Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 14:16 -0800
          Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-13 14:17 -0800
  Re: compile "a = 2*f+(d-g/3)*(9-i)" luser droog <luser.droog@gmail.com> - 2017-02-13 19:36 -0800
    Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-14 00:32 -0800
  Re: compile "a = 2*f+(d-g/3)*(9-i)" John Bode <jfbode1029@gmail.com> - 2017-02-15 13:27 -0800
    Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-15 13:47 -0800
      Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-15 14:13 -0800
        Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-15 14:16 -0800
          Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-15 14:40 -0800
      Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-16 14:57 -0800
        Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-16 15:02 -0800
          Re: compile "a = 2*f+(d-g/3)*(9-i)" fir <profesor.fir@gmail.com> - 2017-02-21 11:15 -0800

csiph-web