EmbeddedRelated.com
Forums

how to convert ads to iar?

Started by lzh08 May 21, 2007
"lzh08" <cppcpldfpga@gmail.com> wrote in message 
news:1179732737.322113.259380@b40g2000prd.googlegroups.com...
> who could tell me?thx
Without knowing what you want to convert then no-one can help you. If you've written ANSI C then everything will run just dandy. However, if you've used compiler extensions then you need to find the appropriate extensions under IAR. Their support people are very helpful (at a price) and respond quickly. If you write code that conforms to standards and liberally document the places where it doesn't then you won't get this problem in the future.
On 21/05/2007 Chris Hills wrote:

> In article <f2sl6q.1o4.1@stefan.msgid.phost.de>, Stefan Reuther > <stefan.news@arcor.de> writes > > Chris Hills wrote: > > > /* "keil" to "iar" will need some thinking about */ > > > > No problem. > > > > #include <stdio.h> > > int main() { > > char x[6]; > > fgets(x, 6, stdin); > > printf("%c%c%c\n", x[2], x[1] - 4, x[0]+x[3]-x[1]); > > return 0; > > } > > > > Even works for upper-case :-) > > > Any one want to try "windriver" to" iar"? :-)
#include <stdio.h> int main() { char x[11]; char *p = &x[1]; fgets(x, 11, stdin); printf("%c", *p); p += 2; printf("%c", *p - 3); p += 5; printf("%c\n", *p); return 0; } -- John B
Chris Hills wrote:
>
... snip ...
> > /* how to convert ads to iar? */ > > #include <stdio.h> > > int main(void ) > { > char one = 'a'; > char two ='d'; > char three ='s'; > char four = 8; > char five = 3; > char six =1; > printf("%c %c %c \n", one, two, three); > > one = one + four; > two = two -five; > three = three - six; > printf("%c %c %c \n", one, two, three); > > return 0; > }
Fails if the char. set is ebcdic (or some others) :-) -- <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt> <http://www.securityfocus.com/columnists/423> <http://www.aaxnet.com/editor/edit043.html> <http://kadaitcha.cx/vista/dogsbreakfast/index.html> cbfalconer at maineline dot net -- Posted via a free Usenet account from http://www.teranews.com