<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Zpr&aacute;va</TITLE>

<META content="MSHTML 6.00.2900.3527" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640590910-22052009>Ukazka 
GCC na platforme ARM 7:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>Poznamka:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640590910-22052009>Kod v 
C neni zrovna dobre napasan pro prenos na jine platformy.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640590910-22052009>Pokud 
to neni nutne jinak, tak pouzivat typ int, ktery je nativni a kompilator pak 
neprovadi</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>zbytecne operace aby mu typ "sedl" do 
registru.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>Slavek</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>Upraveny C kod:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640590910-22052009><FONT 
size=2>
<P align=left></FONT><B><FONT color=#7f0055 size=2><FONT color=#7f0055 
size=2>unsigned</B></FONT></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 
size=2><FONT color=#7f0055 size=2>char</B></FONT></FONT><FONT size=2> 
Pole[</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>32</B></FONT></FONT><FONT size=2>] = {</P>
<P align=left></FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>0</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>1</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>2</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>3</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>4</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>5</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>6</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>7</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>8</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>9</B></FONT></FONT><FONT size=2>,</P>
<P align=left></FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>0</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>1</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>2</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>3</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>4</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>5</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>6</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>7</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>8</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>9</B></FONT></FONT><FONT size=2>,</P>
<P align=left></FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>0</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>1</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>2</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>3</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>4</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>5</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>6</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>7</B></FONT></FONT><FONT 
size=2>,</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>8</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>9</B></FONT></FONT><FONT size=2>,</P>
<P align=left></FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>0</B></FONT></FONT><FONT size=2>,</FONT><B><FONT color=#0000ff 
size=2><FONT color=#0000ff size=2>1</P></B></FONT></FONT><FONT size=2>
<P align=left>};</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2><FONT color=#7f0055 
size=2>int</B></FONT></FONT><FONT size=2> Soucet;</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2><FONT color=#7f0055 
size=2>void</B></FONT></FONT><FONT size=2> <B>mainHW</B>(</FONT><B><FONT 
color=#7f0055 size=2><FONT color=#7f0055 size=2>void</B></FONT></FONT><FONT 
size=2>) {</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2><FONT color=#7f0055 
size=2>unsigned</B></FONT></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 
size=2><FONT color=#7f0055 size=2>char</B></FONT></FONT><FONT size=2>* 
uc=Pole;</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2><FONT color=#7f0055 
size=2>for</B></FONT></FONT><FONT size=2> (</FONT><B><FONT color=#7f0055 
size=2><FONT color=#7f0055 size=2>int</B></FONT></FONT><FONT size=2> Ukazatel = 
</FONT><B><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>0</B></FONT></FONT><FONT size=2>; Ukazatel &lt; </FONT><B><FONT 
color=#0000ff size=2><FONT color=#0000ff size=2>32</B></FONT></FONT><FONT 
size=2>; ++Ukazatel) {</P>
<P align=left>Soucet += *uc++;</P>
<P align=left>}</P>
<P align=left>}</P></FONT></SPAN></FONT><FONT face=Arial color=#0000ff 
size=2><SPAN class=640590910-22052009><FONT size=2></DIV></FONT></SPAN></FONT>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640590910-22052009>GCC 
4.1 ARM 7</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>&nbsp;.global&nbsp;_Z6mainHWv<BR>&nbsp;.type&nbsp;_Z6mainHWv, 
%function<BR>_Z6mainHWv:<BR>.LFB19:<BR>&nbsp;.file 1 "../main.cpp"<BR>&nbsp;.loc 
1 77 0<BR>&nbsp;@ args = 0, pretend = 0, frame = 0<BR>&nbsp;@ frame_needed = 0, 
uses_anonymous_args = 0<BR>&nbsp;@ link register save 
eliminated.<BR>&nbsp;ldr&nbsp;ip, .L6<BR>&nbsp;ldr&nbsp;r0, 
.L6+4<BR>&nbsp;ldrb&nbsp;r1, [ip, #0]&nbsp;@ 
zero_extendqisi2<BR>&nbsp;mov&nbsp;r2, #0<BR>.L2:<BR>&nbsp;ldrb&nbsp;r3, [r0, 
r2]&nbsp;@ zero_extendqisi2<BR>&nbsp;add&nbsp;r2, r2, #1<BR>&nbsp;add&nbsp;r3, 
r3, r1<BR>&nbsp;cmp&nbsp;r2, #32<BR>&nbsp;and&nbsp;r1, r3, 
#255<BR>&nbsp;bne&nbsp;.L2<BR>&nbsp;strb&nbsp;r1, [ip, 
#0]<BR>&nbsp;bx&nbsp;lr</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>Upraveny kod:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009>&nbsp;ldr&nbsp;ip, .L6<BR>&nbsp;ldr&nbsp;r2, 
.L6+4<BR>&nbsp;ldr&nbsp;r1, [ip, #0]<BR>&nbsp;add&nbsp;r0, r2, 
#32<BR>.L2:<BR>&nbsp;ldrb&nbsp;r3, [r2, #-1]&nbsp;@ 
zero_extendqisi2<BR>&nbsp;add&nbsp;r2, r2, #1<BR>&nbsp;cmp&nbsp;r2, 
r0<BR>&nbsp;add&nbsp;r1, r1, r3<BR>&nbsp;bne&nbsp;.L2<BR>&nbsp;str&nbsp;r1, [ip, 
#0]<BR>&nbsp;bx&nbsp;lr</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=640590910-22052009></SPAN></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=cs dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> hw-list-bounces@list.hw.cz 
  [mailto:hw-list-bounces@list.hw.cz] <B>On Behalf Of </B>Michal 
  HW<BR><B>Sent:</B> Friday, May 22, 2009 9:46 AM<BR><B>To:</B> 
  HW-news<BR><B>Subject:</B> Re: C nebo ASM?<BR><BR></FONT></DIV>
  <DIV><FONT face=Arial size=2>PIC18 STD</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>volatile unsigned char Pole[32] = 
  {<BR>&nbsp;0,1,2,3,4,5,6,7,8,9,&nbsp;<BR>&nbsp;0,1,2,3,4,5,6,7,8,9,&nbsp;<BR>&nbsp;0,1,2,3,4,5,6,7,8,9,&nbsp;<BR>&nbsp;0,1&nbsp;<BR>};<BR>unsigned 
  char Soucet;</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV><FONT face=Arial size=2>
  <DIV><FONT color=#0000ff></FONT><BR>void main(void) {<BR>&nbsp;<BR>&nbsp;auto 
  unsigned char Ukazatel;<BR>&nbsp;<BR>&nbsp;for ( Ukazatel = 0; Ukazatel &lt; 
  32; ++Ukazatel) {<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;Soucet += 
  Pole[Ukazatel];<BR>&nbsp;}&nbsp;</DIV>
  <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
  <DIV>}<BR></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>