Re: optimizing an asm-like language

Walter Banks <walter@bytecraft.com>
Mon, 04 Feb 2008 14:56:40 -0500

          From comp.compilers

Related articles
optimizing an asm-like language rdentato@news.tin.it (Remo D.) (2008-01-29)
Re: optimizing an asm-like language cfc@shell01.TheWorld.com (Chris F Clark) (2008-01-30)
Re: optimizing an asm-like language rdentato@news.tin.it (Remo D.) (2008-02-03)
Re: optimizing an asm-like language walter@bytecraft.com (Walter Banks) (2008-02-04)
| List of all articles for this month |

From: Walter Banks <walter@bytecraft.com>
Newsgroups: comp.compilers
Date: Mon, 04 Feb 2008 14:56:40 -0500
Organization: Compilers Central
References: 08-01-079 08-02-003 08-02-017
Keywords: optimize
Posted-Date: 06 Feb 2008 21:51:20 EST

"Remo D." wrote:


> I'm now converting the ASM code to C so I can create and execute a
> comprehensive test suite and get confidence on the correctness of my
> approach.
>
> Let's get back to coding ...
>
> Remo.D.
>
> --
>
> Code for '[a-z]?n'
>
> 1 S1: GET
> 2 CMP 'n'
> 3 JGT L3
> 4 JEQ S4
> 5 CMP 'a'
> 6 RLT
> 7 JMP S2
> 8 L3: CMP 'z'
> 9 RGT
> 10 JMP S2
> 11 S4: MTC 1
> 12 GET
> 13 CMP 'n'
> 14 RNE
> 15 S3: MTC 1
> 16 RET
> 17 S2: GET
> 18 CMP 'n'
> 19 RNE
> 20 JMP S3


You might want to check common sub expression lines 13/14 and 18/19.
From experience C as an intermediate code does work quite well.


Walter Banks



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.