<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Lowyat.NET: Latest topics by greenwire85</title>
        <description></description>
        <link>http://forum.lowyat.net/</link>
        <lastBuildDate>Tue, 09 Jun 2026 08:40:40 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>lol wot</title>
            <link>http://forum.lowyat.net/topic/1106249</link>
            <description>&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;A simple C-function to send characters is this one&amp;#58;&lt;br /&gt;&lt;br /&gt;void UART1_T&amp;#40;unsigned char ch&amp;#41;&lt;br /&gt;{&lt;br /&gt;while&amp;#40;&amp;#40;IORD_ALTERA_AVALON_UART_STATUS&amp;#40;UART_BASE&amp;#41; &amp;amp; 0x040&amp;#41; &amp;#33;= 0x040&amp;#41;&lt;br /&gt;{;}&lt;br /&gt;IOWR_ALTERA_AVALON_UART_TXDATA&amp;#40;UART_BASE,ch&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;#include &amp;#60;string.h&amp;#62;&lt;br /&gt;&lt;br /&gt;int main&amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt;    FILE* fp;&lt;br /&gt;    char prompt = 0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    fp = fopen&amp;#40;&amp;#34;/dev/uart&amp;#34;, &amp;#34;r+&amp;#34;&amp;#41;;&lt;br /&gt;&lt;br /&gt;    if&amp;#40;fp&amp;#41;{&lt;br /&gt; printf&amp;#40;&amp;#34;UART open. &amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    }&lt;br /&gt;    else{&lt;br /&gt; printf&amp;#40;&amp;#34;UART closed. &amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;       return 0;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    fprintf&amp;#40;fp, &amp;#34;UART&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    while&amp;#40;prompt &amp;#33;= &amp;#39;v&amp;#39;&amp;#41;{&lt;br /&gt; prompt = getc&amp;#40;fp&amp;#41;;&lt;br /&gt; printf&amp;#40;&amp;#34;&amp;#91;%c&amp;#93; &amp;#092;n&amp;#34;, prompt&amp;#41;;&lt;br /&gt;    }&lt;br /&gt;    fclose&amp;#40;fp&amp;#41;;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;/* A simple program that recognizes the characters &amp;#39;t&amp;#39; and &amp;#39;v&amp;#39; */&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;#include &amp;#60;string.h&amp;#62;&lt;br /&gt;int main &amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt;  char* msg = &amp;#34;Detected the character &amp;#39;t&amp;#39;.&amp;#092;n&amp;#34;;&lt;br /&gt;  FILE* fp;&lt;br /&gt;  char prompt = 0;&lt;br /&gt;  fp = fopen &amp;#40;&amp;#34;/dev/uart1&amp;#34;, &amp;#34;r+&amp;#34;&amp;#41;; //Open file for reading and writing&lt;br /&gt;  if &amp;#40;fp&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    while &amp;#40;prompt &amp;#33;= &amp;#39;v&amp;#39;&amp;#41; &lt;br /&gt;    {  // Loop until we receive a &amp;#39;v&amp;#39;.&lt;br /&gt;      prompt = getc&amp;#40;fp&amp;#41;;  // Get a character from the UART.&lt;br /&gt;      if &amp;#40;prompt == &amp;#39;t&amp;#39;&amp;#41;&lt;br /&gt;      {  // Print a message if character is &amp;#39;t&amp;#39;.&lt;br /&gt;        fwrite &amp;#40;msg, strlen &amp;#40;msg&amp;#41;, 1, fp&amp;#41;;&lt;br /&gt;      }&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;// Copyright &amp;#40;c&amp;#41; 2005 by Terasic Technologies Inc. &lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;//&lt;br /&gt;// Permission&amp;#58;&lt;br /&gt;//&lt;br /&gt;//   Terasic grants permission to use and modify this code for use&lt;br /&gt;//   in synthesis for all Terasic Development Boards and Altera Development &lt;br /&gt;//   Kits made by Terasic.  Other use of this code, including the selling &lt;br /&gt;//   ,duplication, or modification of any portion is strictly prohibited.&lt;br /&gt;//&lt;br /&gt;// Disclaimer&amp;#58;&lt;br /&gt;//&lt;br /&gt;//   This VHDL/Verilog or C/C++ source code is intended as a design reference&lt;br /&gt;//   which illustrates how these types of functions can be implemented.&lt;br /&gt;//   It is the user&amp;#39;s responsibility to verify their design for&lt;br /&gt;//   consistency and functionality through the use of formal&lt;br /&gt;//   verification methods.  Terasic provides no warranty regarding the use &lt;br /&gt;//   or functionality of this code.&lt;br /&gt;//&lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;//           &lt;br /&gt;//                     Terasic Technologies Inc&lt;br /&gt;//                     356 Fu-Shin E. Rd Sec. 1. JhuBei City,&lt;br /&gt;//                     HsinChu County, Taiwan&lt;br /&gt;//                     302&lt;br /&gt;//&lt;br /&gt;//                     web&amp;#58; http&amp;#58;//www.terasic.com/&lt;br /&gt;//                     email&amp;#58; support@terasic.com&lt;br /&gt;//&lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;//&lt;br /&gt;// Major Functions&amp;#58;	DE2 TOP LEVEL&lt;br /&gt;//&lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;//&lt;br /&gt;// Revision History &amp;#58;&lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;//   Ver  &amp;#58;| Author            &amp;#58;| Mod. Date &amp;#58;| Changes Made&amp;#58;&lt;br /&gt;//   V1.0 &amp;#58;| Johnny Chen       &amp;#58;| 05/08/19  &amp;#58;|      Initial Revision&lt;br /&gt;//   V1.1 &amp;#58;| Johnny Chen       &amp;#58;| 05/11/16  &amp;#58;|      Added FLASH Address FL_ADDR&amp;#91;21&amp;#58;20&amp;#93;&lt;br /&gt;//   V1.2 &amp;#58;| Johnny Chen       &amp;#58;| 05/11/16  &amp;#58;|  Fixed ISP1362 INT/DREQ Pin Direction.   &lt;br /&gt;// --------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;module project_segClass&lt;br /&gt;	&amp;#40;&lt;br /&gt;  ////////////////////	Clock Input  	////////////////////  &lt;br /&gt;  CLOCK_50,      //	50 MHz&lt;br /&gt;  ////////////////////	Push Button  ////////////////////&lt;br /&gt;  KEY,      	//	Pushbutton&amp;#91;3&amp;#58;0&amp;#93;&lt;br /&gt;  ////////////////////////	UART	////////////////////////&lt;br /&gt;  UART_TXD,      //	UART Transmitter&lt;br /&gt;  UART_RXD,      //	UART Receiver&lt;br /&gt;  /////////////////////	SDRAM Interface  ////////////////&lt;br /&gt;  DRAM_DQ,      //	SDRAM Data bus 16 Bits&lt;br /&gt;  DRAM_ADDR,      //	SDRAM Address bus 12 Bits&lt;br /&gt;  DRAM_LDQM,      //	SDRAM Low-byte Data Mask &lt;br /&gt;  DRAM_UDQM,      //	SDRAM High-byte Data Mask&lt;br /&gt;  DRAM_WE_N,      //	SDRAM Write Enable&lt;br /&gt;  DRAM_CAS_N,      //	SDRAM Column Address Strobe&lt;br /&gt;  DRAM_RAS_N,      //	SDRAM Row Address Strobe&lt;br /&gt;  DRAM_CS_N,      //	SDRAM Chip Select&lt;br /&gt;  DRAM_BA_0,      //	SDRAM Bank Address 0&lt;br /&gt;  DRAM_BA_1,      //	SDRAM Bank Address 0&lt;br /&gt;  DRAM_CLK,      //	SDRAM Clock&lt;br /&gt;  DRAM_CKE,      //	SDRAM Clock Enable&lt;br /&gt;  ////////////////////	LCD Module 16X2  ////////////////&lt;br /&gt;  LCD_ON,      	//	LCD Power ON/OFF&lt;br /&gt;  LCD_BLON,      //	LCD Back Light ON/OFF&lt;br /&gt;  LCD_RW,      	//	LCD Read/Write Select, 0 = Write, 1 = Read&lt;br /&gt;  LCD_EN,      	//	LCD Enable&lt;br /&gt;  LCD_RS,      	//	LCD Command/Data Select, 0 = Command, 1 = Data&lt;br /&gt;  LCD_DATA,      //	LCD Data bus 8 bits&lt;br /&gt;  ////////////////////	USB JTAG link	////////////////////&lt;br /&gt;  TDI,        	// CPLD -&amp;#62; FPGA &amp;#40;data in&amp;#41;&lt;br /&gt;  TCK,        	// CPLD -&amp;#62; FPGA &amp;#40;clk&amp;#41;&lt;br /&gt;  TCS,        	// CPLD -&amp;#62; FPGA &amp;#40;CS&amp;#41;&lt;br /&gt;     TDO,        	// FPGA -&amp;#62; CPLD &amp;#40;data out&amp;#41;&lt;br /&gt;  &lt;br /&gt;	&amp;#41;;&lt;br /&gt;&lt;br /&gt;////////////////////////	Clock Input  	////////////////////////&lt;br /&gt;input  	CLOCK_50;    //	50 MHz&lt;br /&gt;////////////////////////	Push Button  ////////////////////////&lt;br /&gt;input	&amp;#91;0&amp;#58;0&amp;#93;	KEY;    	//	Pushbutton&amp;#91;3&amp;#58;0&amp;#93;&lt;br /&gt;////////////////////////////	UART	////////////////////////////&lt;br /&gt;output  	UART_TXD;    //	UART Transmitter&lt;br /&gt;input  	UART_RXD;    //	UART Receiver&lt;br /&gt;///////////////////////  SDRAM Interface	////////////////////////&lt;br /&gt;inout	&amp;#91;15&amp;#58;0&amp;#93;	DRAM_DQ;    //	SDRAM Data bus 16 Bits&lt;br /&gt;output	&amp;#91;11&amp;#58;0&amp;#93;	DRAM_ADDR;    //	SDRAM Address bus 12 Bits&lt;br /&gt;output  	DRAM_LDQM;    //	SDRAM Low-byte Data Mask &lt;br /&gt;output  	DRAM_UDQM;    //	SDRAM High-byte Data Mask&lt;br /&gt;output  	DRAM_WE_N;    //	SDRAM Write Enable&lt;br /&gt;output  	DRAM_CAS_N;    //	SDRAM Column Address Strobe&lt;br /&gt;output  	DRAM_RAS_N;    //	SDRAM Row Address Strobe&lt;br /&gt;output  	DRAM_CS_N;    //	SDRAM Chip Select&lt;br /&gt;output  	DRAM_BA_0;    //	SDRAM Bank Address 0&lt;br /&gt;output  	DRAM_BA_1;    //	SDRAM Bank Address 0&lt;br /&gt;output  	DRAM_CLK;    //	SDRAM Clock&lt;br /&gt;output  	DRAM_CKE;    //	SDRAM Clock Enable&lt;br /&gt;////////////////////	LCD Module 16X2	////////////////////////////&lt;br /&gt;inout	&amp;#91;7&amp;#58;0&amp;#93;	LCD_DATA;    //	LCD Data bus 8 bits&lt;br /&gt;output  	LCD_ON;    	//	LCD Power ON/OFF&lt;br /&gt;output  	LCD_BLON;    //	LCD Back Light ON/OFF&lt;br /&gt;output  	LCD_RW;    	//	LCD Read/Write Select, 0 = Write, 1 = Read&lt;br /&gt;output  	LCD_EN;    	//	LCD Enable&lt;br /&gt;output  	LCD_RS;    	//	LCD Command/Data Select, 0 = Command, 1 = Data&lt;br /&gt;////////////////////	USB JTAG link	////////////////////////////&lt;br /&gt;input    	TDI;    	// CPLD -&amp;#62; FPGA &amp;#40;data in&amp;#41;&lt;br /&gt;input    	TCK;    	// CPLD -&amp;#62; FPGA &amp;#40;clk&amp;#41;&lt;br /&gt;input    	TCS;    	// CPLD -&amp;#62; FPGA &amp;#40;CS&amp;#41;&lt;br /&gt;output    TDO;    	// FPGA -&amp;#62; CPLD &amp;#40;data out&amp;#41;&lt;br /&gt;&lt;br /&gt;//	Turn on all display&lt;br /&gt;assign	LCD_ON  =	1&amp;#39;b1;&lt;br /&gt;assign	LCD_BLON	=	1&amp;#39;b1;&lt;br /&gt;&lt;br /&gt;// Assign SDRAM clock&lt;br /&gt;//assign DRAM_CLK = CLOCK_50;&lt;br /&gt;&lt;br /&gt;wire pll_c1;&lt;br /&gt;&lt;br /&gt;nios_system u0 &amp;#40;&lt;br /&gt;    //Global signals&lt;br /&gt;    .clk&amp;#40;pll_c1&amp;#41;,&lt;br /&gt;    .reset_n&amp;#40;KEY&amp;#91;0&amp;#93;&amp;#41;,&lt;br /&gt;    &lt;br /&gt;    // the_lcd&lt;br /&gt;                 .LCD_E_from_the_lcd&amp;#40;LCD_EN&amp;#41;,&lt;br /&gt;                 .LCD_RS_from_the_lcd&amp;#40;LCD_RS&amp;#41;,&lt;br /&gt;                 .LCD_RW_from_the_lcd&amp;#40;LCD_RW&amp;#41;,&lt;br /&gt;                 .LCD_data_to_and_from_the_lcd&amp;#40;LCD_DATA&amp;#41;,&lt;br /&gt;&lt;br /&gt;    // the_sdram_0&lt;br /&gt;                 .zs_addr_from_the_sdram&amp;#40;DRAM_ADDR&amp;#41;,&lt;br /&gt;                 .zs_ba_from_the_sdram&amp;#40;{DRAM_BA_1,DRAM_BA_0}&amp;#41;,&lt;br /&gt;                 .zs_cas_n_from_the_sdram&amp;#40;DRAM_CAS_N&amp;#41;,&lt;br /&gt;                 .zs_cke_from_the_sdram&amp;#40;DRAM_CKE&amp;#41;,&lt;br /&gt;                 .zs_cs_n_from_the_sdram&amp;#40;DRAM_CS_N&amp;#41;,&lt;br /&gt;                 .zs_dq_to_and_from_the_sdram&amp;#40;DRAM_DQ&amp;#41;,&lt;br /&gt;                 .zs_dqm_from_the_sdram&amp;#40;{DRAM_UDQM,DRAM_LDQM}&amp;#41;,&lt;br /&gt;                 .zs_ras_n_from_the_sdram&amp;#40;DRAM_RAS_N&amp;#41;,&lt;br /&gt;                 .zs_we_n_from_the_sdram&amp;#40;DRAM_WE_N&amp;#41;,&lt;br /&gt;&lt;br /&gt;    // the_uart&lt;br /&gt;                 .rxd_to_the_uart&amp;#40;UART_RXD&amp;#41;,&lt;br /&gt;                 .txd_from_the_uart&amp;#40;UART_TXD&amp;#41;&lt;br /&gt;    &amp;#41;;&lt;br /&gt;&lt;br /&gt;sdram_pll u1	&amp;#40;&lt;br /&gt;    .inclk0&amp;#40;CLOCK_50&amp;#41;,&lt;br /&gt;    .c0&amp;#40;DRAM_CLK&amp;#41;,&lt;br /&gt;    .c1&amp;#40;pll_c1&amp;#41;&lt;br /&gt;    &amp;#41;;&lt;br /&gt;&lt;br /&gt;endmodule&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;#include &amp;#34;excalibur.h&amp;#34;&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;#include &amp;#60;stdlib.h&amp;#62;&lt;br /&gt;#include &amp;#60;string.h&amp;#62;&lt;br /&gt;#include &amp;#60;math.h&amp;#62;&lt;br /&gt;&lt;br /&gt;#define BYTE unsigned char&lt;br /&gt;#define LEN 4800&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main&amp;#40;&amp;#41;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	unsigned int operation=0;&lt;br /&gt;	char c;&lt;br /&gt;	int i,j,k,l;&lt;br /&gt;	BYTE image1&amp;#91;60&amp;#93;&amp;#91;60&amp;#93;;&lt;br /&gt;	BYTE image2&amp;#91;60&amp;#93;&amp;#91;60&amp;#93;;&lt;br /&gt;	int result1,result2;&lt;br /&gt;	BYTE image&amp;#91;LEN&amp;#93;;      	// array to store characters received from uart&lt;br /&gt;	char first = 0, first_bar = 0, second = 0, second_bar = 0, third = 0, third_bar = 0, fourth = 0;&lt;br /&gt;	int data_len = 0;&lt;br /&gt;	int image_len = 0;&lt;br /&gt;	BYTE data&amp;#91;LEN&amp;#93; = {0};&lt;br /&gt;	BYTE cryptogram&amp;#91;LEN&amp;#93; = {0};&lt;br /&gt;	BYTE cryptogram1&amp;#91;LEN&amp;#93; = {0};&lt;br /&gt;	BYTE image_decode&amp;#91;LEN&amp;#93; = {0};&lt;br /&gt;	int pad = 0;&lt;br /&gt;	int a,p,q;	//baru tmbh&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	np_pio *pio = na_button_pio;&lt;br /&gt;	nr_pio_lcdinit&amp;#40;na_lcd_pio&amp;#41;;&lt;br /&gt;&lt;br /&gt;while&amp;#40;1&amp;#41;&lt;br /&gt;{&lt;br /&gt;	nr_pio_lcdwritescreen&amp;#40;&amp;#34;WELCOME&amp;#33;&amp;#33;&amp;#34;&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;3500&amp;#41;;&lt;br /&gt;  &lt;br /&gt;	&lt;br /&gt;	nr_pio_lcdwritescreen&amp;#40;&amp;#34;HI...... PLEASE SEND 1st DATA&amp;#33;&amp;#33;&amp;#34;&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;3500&amp;#41;;&lt;br /&gt;	nr_pio_showhex&amp;#40;0x01&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;3500&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	image_len = 4800;&lt;br /&gt;	for &amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  while &amp;#40;&amp;#40;c = nr_uart_rxchar&amp;#40;nasys_printf_uart&amp;#41;&amp;#41; == -1&amp;#41;;&lt;br /&gt;  image&amp;#91;i&amp;#93; = c;&lt;br /&gt;	}&lt;br /&gt;	i = 0;&lt;br /&gt;	nr_pio_showhex&amp;#40;i&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;500&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	// decode image to binary form&lt;br /&gt;	// convert from base64 ascii code to binary value&lt;br /&gt;	for&amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  cryptogram&amp;#91;i&amp;#93; = image&amp;#91;i&amp;#93; - 60;&lt;br /&gt;	}&lt;br /&gt;	data_len = 0;&lt;br /&gt;	for&amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  // decode 1st byte&lt;br /&gt;  first = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  first_bar = first &amp;#60;&amp;#60; 2;&lt;br /&gt;  i++;&lt;br /&gt;&lt;br /&gt;  // decode 2nd byte&lt;br /&gt;  second = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  second_bar = second &amp;amp; 0x30;&lt;br /&gt;  second_bar = second_bar &amp;#62;&amp;#62; 4;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = first_bar | second_bar;&lt;br /&gt;  data_len++;&lt;br /&gt;  second_bar = second &amp;amp; 0x0f;&lt;br /&gt;  second_bar = second_bar &amp;#60;&amp;#60; 4;&lt;br /&gt;  i++;&lt;br /&gt;&lt;br /&gt;  // decode 3rd byte&lt;br /&gt;  third = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  third_bar = third &amp;amp; 0x3c;&lt;br /&gt;  third_bar = third_bar &amp;#62;&amp;#62; 2;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = second_bar | third_bar;&lt;br /&gt;  i++;&lt;br /&gt;  data_len++;&lt;br /&gt;  third_bar = third &amp;amp; 0x03;&lt;br /&gt;  third_bar = third_bar &amp;#60;&amp;#60; 6;&lt;br /&gt;&lt;br /&gt;  // decode 4th byte&lt;br /&gt;  fourth = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = third_bar | fourth;&lt;br /&gt;  data_len++;&lt;br /&gt;	}&lt;br /&gt;	a=0;&lt;br /&gt;	for &amp;#40;i = 0; i &amp;#60; 60; i++&amp;#41;&lt;br /&gt;	{	&lt;br /&gt;  for &amp;#40;j = 0; j &amp;#60; 60; j++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;  	image1&amp;#91;j&amp;#93;&amp;#91;i&amp;#93; = image_decode&amp;#91;a&amp;#93;;&lt;br /&gt;  	a++;&lt;br /&gt;  }&lt;br /&gt;	}&lt;br /&gt;	//flip_image_array&amp;#40;image1, 60, 60&amp;#41;;&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;	nr_pio_showhex&amp;#40;0x02&amp;#41;;	&lt;br /&gt;	nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	nr_pio_lcdwritescreen&amp;#40;&amp;#34;PLEASE SEND 2nd DATA&amp;#33;&amp;#33;&amp;#34;&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;1000&amp;#41;;&lt;br /&gt;&lt;br /&gt;	image_len = 4800;&lt;br /&gt;	for &amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  while &amp;#40;&amp;#40;c = nr_uart_rxchar&amp;#40;nasys_printf_uart&amp;#41;&amp;#41; == -1&amp;#41;;&lt;br /&gt;  image&amp;#91;i&amp;#93; = c;&lt;br /&gt;	}&lt;br /&gt;	i = 0;&lt;br /&gt;	nr_pio_showhex&amp;#40;i&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;500&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	// decode image to binary form&lt;br /&gt;	// convert from base64 ascii code to binary value&lt;br /&gt;	for&amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  cryptogram&amp;#91;i&amp;#93; = image&amp;#91;i&amp;#93; - 60;&lt;br /&gt;	}&lt;br /&gt;	data_len = 0;&lt;br /&gt;	for&amp;#40;i = 0; i &amp;#60; image_len; i++&amp;#41;&lt;br /&gt;	{&lt;br /&gt;  // decode 1st byte&lt;br /&gt;  first = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  first_bar = first &amp;#60;&amp;#60; 2;&lt;br /&gt;  i++;&lt;br /&gt;&lt;br /&gt;  // decode 2nd byte&lt;br /&gt;  second = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  second_bar = second &amp;amp; 0x30;&lt;br /&gt;  second_bar = second_bar &amp;#62;&amp;#62; 4;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = first_bar | second_bar;&lt;br /&gt;  data_len++;&lt;br /&gt;  second_bar = second &amp;amp; 0x0f;&lt;br /&gt;  second_bar = second_bar &amp;#60;&amp;#60; 4;&lt;br /&gt;  i++;&lt;br /&gt;&lt;br /&gt;  // decode 3rd byte&lt;br /&gt;  third = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  third_bar = third &amp;amp; 0x3c;&lt;br /&gt;  third_bar = third_bar &amp;#62;&amp;#62; 2;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = second_bar | third_bar;&lt;br /&gt;  i++;&lt;br /&gt;  data_len++;&lt;br /&gt;  third_bar = third &amp;amp; 0x03;&lt;br /&gt;  third_bar = third_bar &amp;#60;&amp;#60; 6;&lt;br /&gt;&lt;br /&gt;  // decode 4th byte&lt;br /&gt;  fourth = cryptogram&amp;#91;i&amp;#93;;&lt;br /&gt;  image_decode&amp;#91;data_len&amp;#93; = third_bar | fourth;&lt;br /&gt;  data_len++;&lt;br /&gt;	}&lt;br /&gt;	a=0;&lt;br /&gt;	for &amp;#40;i = 0; i &amp;#60; 60; i++&amp;#41;&lt;br /&gt;	{	&lt;br /&gt;  for &amp;#40;j = 0; j &amp;#60; 60; j++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;  	image2&amp;#91;j&amp;#93;&amp;#91;i&amp;#93; = image_decode&amp;#91;a&amp;#93;;&lt;br /&gt;  	a++;&lt;br /&gt;  }&lt;br /&gt;	}&lt;br /&gt;	//flip_image_array&amp;#40;image2, 60 , 60 &amp;#41;;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	/*COMPARE DATA AND PRINT SCREEN*/&lt;br /&gt;&lt;br /&gt;//	printf&amp;#40;&amp;#34;Tumor Region &amp;#58;&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//	{&lt;br /&gt;&lt;br /&gt;  for &amp;#40;k=0; k&amp;#60;60; k++&amp;#41;&lt;br /&gt;  { &lt;br /&gt;  	for &amp;#40;l=0; l&amp;#60;60; l++&amp;#41;&lt;br /&gt;  	{  &lt;br /&gt;    result1=image1 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93; - image2 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;;&lt;br /&gt;  	//	nr_pio_showhex&amp;#40;result1&amp;#41;;nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;    result2=image2 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93; - image1 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;;&lt;br /&gt;  	//	nr_pio_showhex&amp;#40;result2&amp;#41;;nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;    if &amp;#40;&amp;#40;result1 &amp;#41;&amp;#62;3&amp;#41;&lt;br /&gt;    {	&lt;br /&gt;    	if &amp;#40;&amp;#40;k==20&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==19&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 1  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==29&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==42&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 2  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==43&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==18&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 3  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==19&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==39&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 4  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==50&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==32&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 5  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    	printf&amp;#40;&amp;#34;coordinate &amp;#58; &amp;#40;%03d, %03d&amp;#41;,  &amp;#092;t&amp;#34;,k,l&amp;#41;;&lt;br /&gt;    	printf&amp;#40;&amp;#34;normal &amp;#58; %d &amp;#092;t abnormal &amp;#58;  %d,  &amp;#092;t &amp;#34;, image1 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;, image2 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;&amp;#41;;&lt;br /&gt;    	printf&amp;#40;&amp;#34;different &amp;#58; %d, &amp;#092;n&amp;#34; , result1&amp;#41;;&lt;br /&gt;    	//nr_pio_showhex&amp;#40;result1&amp;#41;;	&lt;br /&gt;    	//nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;    }&lt;br /&gt;    else if &amp;#40;&amp;#40;result2 &amp;#41;&amp;#62;3&amp;#41;&lt;br /&gt;    {&lt;br /&gt;    	if &amp;#40;&amp;#40;k==20&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==19&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 1  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==29&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==42&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 2  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==43&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==18&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 3  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==19&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==39&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 4  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    	else if &amp;#40;&amp;#40;k==50&amp;#41;&amp;amp;&amp;amp;&amp;#40;l==32&amp;#41;&amp;#41;&lt;br /&gt;    	{printf&amp;#40;&amp;#34;CASE 5  &amp;#58;&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;}&lt;br /&gt;    &lt;br /&gt;    	&lt;br /&gt;&lt;br /&gt;    	printf&amp;#40;&amp;#34;coordinate &amp;#58; &amp;#40;%03d, %03d&amp;#41;,  &amp;#092;t&amp;#34;,k,l&amp;#41;;&lt;br /&gt;    	printf&amp;#40;&amp;#34;normal &amp;#58; %d &amp;#092;t abnormal &amp;#58;  %d,  &amp;#092;t &amp;#34;, image1 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;, image2 &amp;#91;k&amp;#93;&amp;#91;l&amp;#93;&amp;#41;;&lt;br /&gt;    	printf&amp;#40;&amp;#34;different &amp;#58; %d, &amp;#092;n&amp;#34; , result2&amp;#41;;&lt;br /&gt;    	//nr_pio_showhex&amp;#40;result2&amp;#41;;	&lt;br /&gt;    	//nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;  	}&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	nr_pio_lcdwritescreen&amp;#40;&amp;#34;CLICK TUMOR DETECTION&amp;#33;&amp;#33;&amp;#34;&amp;#41;;&lt;br /&gt;	nr_delay&amp;#40;1500&amp;#41;;&lt;br /&gt;	nr_pio_showhex&amp;#40;0x03&amp;#41;;	&lt;br /&gt;	nr_delay &amp;#40;1000&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	while &amp;#40;&amp;#40;operation = nr_uart_rxchar&amp;#40;nasys_printf_uart&amp;#41;&amp;#41; &amp;#33;= 10&amp;#41;;&lt;br /&gt;&lt;br /&gt;  nr_pio_lcdwritescreen&amp;#40;&amp;#34;THANKS FOR USING THIS SYSTEM&amp;#33;&amp;#33;&amp;#34;&amp;#41;;&lt;br /&gt;  nr_delay&amp;#40;1000&amp;#41;;&lt;br /&gt;	&lt;br /&gt;	nr_pio_showhex&amp;#40;0x04&amp;#41;;	&lt;br /&gt;	nr_delay &amp;#40;500&amp;#41;;&lt;br /&gt;}&lt;br /&gt;//	}&lt;br /&gt;	return 0;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;#include &amp;#60;stddef.h&amp;#62;&lt;br /&gt;#include &amp;#60;unistd.h&amp;#62;&lt;br /&gt;#include &amp;#60;fcntl.h&amp;#62;&lt;br /&gt;#include &amp;#60;stdlib.h&amp;#62;&lt;br /&gt;#include &amp;#34;system.h&amp;#34;&lt;br /&gt;#include &amp;#34;sys/alt_dma.h&amp;#34;&lt;br /&gt;#include &amp;#34;sys/alt_alarm.h&amp;#34;&lt;br /&gt;#include &amp;#34;sys/alt_cache.h&amp;#34;&lt;br /&gt;&lt;br /&gt;#include &amp;#34;sys/alt_dev.h&amp;#34;&lt;br /&gt;#include &amp;#34;priv/alt_file.h&amp;#34;&lt;br /&gt;#include &amp;#34;alt_types.h&amp;#34; &lt;br /&gt;&lt;br /&gt;// the dimensions of the graphics display&lt;br /&gt;#define PIX_MAP_WIDTH 640&lt;br /&gt;#define PIX_MAP_HEIGHT 480&lt;br /&gt;&lt;br /&gt;// the dimensions for a software cursor&lt;br /&gt;#define CURSOR_WIDTH 16&lt;br /&gt;#define CURSOR_HEIGHT 16&lt;br /&gt;&lt;br /&gt;// some common color values, based on RGB565&lt;br /&gt;#define BLACK 0x0000&lt;br /&gt;#define RED   0xf800&lt;br /&gt;#define GREEN 0x07e0&lt;br /&gt;#define BLUE  0x001f&lt;br /&gt;#define WHITE 0xffff&lt;br /&gt;&lt;br /&gt;#define READ_BUFFER_SIZE 64&lt;br /&gt;&lt;br /&gt;// globally allocate 2 video frame buffers, a main and an alternate&lt;br /&gt;unsigned short main_frame_buffer&amp;#91;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#93;;&lt;br /&gt;&lt;br /&gt;// other miscellaneous storage&lt;br /&gt;alt_dma_txchan tx_chan;   // tx dma channel descriptor&lt;br /&gt;alt_dma_rxchan rx_chan;   // rx dma channel descriptor&lt;br /&gt;&lt;br /&gt;// define the structure for the VGA ISR context pointer to use, &amp;#40;interupt service routine&amp;#41;&lt;br /&gt;typedef struct {&lt;br /&gt;  volatile unsigned long frame_buffer_base;  // all we need to know in the ISR is where the frame buffer is&lt;br /&gt;} vga_dma_done_context;&lt;br /&gt;&lt;br /&gt;// prototype definitions&lt;br /&gt;void vga_dma_done&amp;#40;vga_dma_done_context *context&amp;#41;;&lt;br /&gt;void print_startup&amp;#40;void&amp;#41;;&lt;br /&gt;void clear_screen&amp;#40;void&amp;#41;;&lt;br /&gt;void paint_marker&amp;#40;void&amp;#41;;&lt;br /&gt;&lt;br /&gt;// the main entry point&lt;br /&gt;int main&amp;#40;void&amp;#41;&lt;br /&gt;{&lt;br /&gt;  volatile vga_dma_done_context my_isr_context; // interupt service routine context storage&lt;br /&gt;  int c;                                        // storage for STDIN character input&lt;br /&gt;  int temp;&lt;br /&gt;  unsigned short *uncached_buffer;&lt;br /&gt;  unsigned char read_buffer&amp;#91;READ_BUFFER_SIZE&amp;#93;;&lt;br /&gt;  int read_cnt;&lt;br /&gt;  int i;&lt;br /&gt;  int next_pixel_offset;&lt;br /&gt;  alt_u32 last_jtag_tick;&lt;br /&gt;  int recent_jtag;&lt;br /&gt;  int next_byte_hi_lo;&lt;br /&gt;  short next_pixel;&lt;br /&gt;  &lt;br /&gt;  // make the frame buffer pointer uncached&lt;br /&gt;  uncached_buffer = &amp;#40;unsigned short *&amp;#41;&amp;#40;alt_remap_uncached&amp;#40; &amp;#40;void *&amp;#41;&amp;#40;main_frame_buffer&amp;#41;, &amp;#40;alt_u32&amp;#41;&amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41;&amp;#41;&amp;#41;;&lt;br /&gt;  &lt;br /&gt;  // forgive me for this hack but I couldn&amp;#39;t figure out a more eligant way to do this&lt;br /&gt;  alt_fd_list&amp;#91;STDIN_FILENO&amp;#93;.fd_flags |= O_NONBLOCK;&lt;br /&gt;  &lt;br /&gt;  // setup context for video dma isr&lt;br /&gt;  my_isr_context.frame_buffer_base = &amp;#40;unsigned long&amp;#41;&amp;#40;main_frame_buffer&amp;#41;;&lt;br /&gt;&lt;br /&gt;  // Start the frame buffer DMA to get a video picture driving out the VGA channel&lt;br /&gt;  &lt;br /&gt;  // open the dma channel for transmitting&lt;br /&gt;  tx_chan = alt_dma_txchan_open &amp;#40;&amp;#34;/dev/dma_0&amp;#34;&amp;#41;;&lt;br /&gt;  if &amp;#40;tx_chan == NULL&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf&amp;#40;&amp;#34;DMA TX channel failed to open.&amp;#092;n&amp;#092;nExiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    return&amp;#40;-1&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;/*&lt;br /&gt;  // open the dma channel for reception&lt;br /&gt;  rx_chan = alt_dma_rxchan_open &amp;#40;&amp;#34;/dev/dma_0&amp;#34;&amp;#41;;&lt;br /&gt;  if &amp;#40;rx_chan == NULL&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf&amp;#40;&amp;#34;DMA RX channel failed to open.&amp;#092;n&amp;#092;nExiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    return&amp;#40;-1&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;*/&lt;br /&gt;  // set dma mode for 32-bit transfers&lt;br /&gt;  temp = alt_dma_txchan_ioctl &amp;#40; tx_chan,&lt;br /&gt;                                ALT_DMA_SET_MODE_32,&lt;br /&gt;                                NULL&amp;#41;;&lt;br /&gt;  if&amp;#40;temp &amp;#60; 0&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf&amp;#40;&amp;#34;Error configuring DMA channel - ALT_DMA_SET_MODE_32&amp;#092;n&amp;#092;n Exiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    return&amp;#40;-1&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;  // set dma mode for rx streaming&lt;br /&gt;  temp = alt_dma_txchan_ioctl &amp;#40; tx_chan,&lt;br /&gt;                                ALT_DMA_RX_STREAM_ON,&lt;br /&gt;                                &amp;#40;void *&amp;#41;&amp;#40;0x0&amp;#41;&amp;#41;;&lt;br /&gt;  if&amp;#40;temp &amp;#60; 0&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf&amp;#40;&amp;#34;Error configuring DMA channel - ALT_DMA_RX_STREAM_ON&amp;#092;n&amp;#092;n Exiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    return&amp;#40;-1&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;  // queue the dma transfer to copy frame buffer&lt;br /&gt;  temp = alt_dma_txchan_send &amp;#40;  tx_chan,&lt;br /&gt;                                &amp;#40;const void*&amp;#41;&amp;#40;main_frame_buffer&amp;#41;,&lt;br /&gt;                                &amp;#40;&amp;#40; PIX_MAP_WIDTH * PIX_MAP_HEIGHT &amp;#41; + PIX_MAP_WIDTH&amp;#41; * 2 * 2,&lt;br /&gt;                                &amp;#40;alt_txchan_done *&amp;#41;&amp;#40;vga_dma_done&amp;#41;,&lt;br /&gt;                                &amp;#40;void*&amp;#41;&amp;#40;&amp;amp;my_isr_context&amp;#41;&amp;#41;;&lt;br /&gt;  if&amp;#40;temp &amp;#60; 0&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf&amp;#40;&amp;#34;Error starting DMA channel&amp;#092;n&amp;#092;n Exiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;    return&amp;#40;-1&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // clear the VGA display and print the menu out the STDOUT interface&lt;br /&gt;  clear_screen&amp;#40;&amp;#41;;&lt;br /&gt;&lt;br /&gt;  // print the menu display out stdout&lt;br /&gt;  print_startup&amp;#40;&amp;#41;;&lt;br /&gt;&lt;br /&gt;  // initialize the globals for image download&lt;br /&gt;  next_pixel_offset = 0;&lt;br /&gt;  next_byte_hi_lo = 1;&lt;br /&gt;  next_pixel = 0;&lt;br /&gt;  &lt;br /&gt;  recent_jtag = 1;&lt;br /&gt;  last_jtag_tick = alt_nticks&amp;#40;&amp;#41;;&lt;br /&gt;  &lt;br /&gt;  // flush any stale STDIN data&lt;br /&gt;  while&amp;#40;&amp;#40;c=getchar&amp;#40;&amp;#41;&amp;#41; &amp;#33;= -1&amp;#41;;&lt;br /&gt;  &lt;br /&gt;  // this is the main continous loop for this program it continually polls for&lt;br /&gt;  // input on STDIN&lt;br /&gt;  while&amp;#40;1&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    // read stdin&lt;br /&gt;    read_cnt = read&amp;#40; STDIN_FILENO, read_buffer, READ_BUFFER_SIZE&amp;#41;;&lt;br /&gt;    &lt;br /&gt;    if&amp;#40;read_cnt == -1&amp;#41;  // there was no data read&lt;br /&gt;    {&lt;br /&gt;      // clear this so the next while loop doesn&amp;#39;t execute&lt;br /&gt;      read_cnt = 0;&lt;br /&gt;      &lt;br /&gt;      // see if we&amp;#39;re waiting for JTAG activity to timeout&lt;br /&gt;      if&amp;#40;recent_jtag&amp;#41;&lt;br /&gt;      {&lt;br /&gt;        // after 5 seconds of no JTAG we reset the next_pixel_offset and paint the marker&lt;br /&gt;        if&amp;#40;&amp;#40;&amp;#40;alt_nticks&amp;#40;&amp;#41;&amp;#41; - last_jtag_tick&amp;#41; &amp;#62;= &amp;#40;5 * &amp;#40;alt_ticks_per_second&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#41;&lt;br /&gt;        {&lt;br /&gt;          paint_marker&amp;#40;&amp;#41;;&lt;br /&gt;          next_pixel_offset = 0;&lt;br /&gt;          recent_jtag = 0;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    else    // there was data read&lt;br /&gt;    {&lt;br /&gt;      last_jtag_tick = alt_nticks&amp;#40;&amp;#41;;&lt;br /&gt;      recent_jtag = 1;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    // process the read buffer data&lt;br /&gt;    i = 0;&lt;br /&gt;    while&amp;#40;read_cnt&amp;#41;&lt;br /&gt;    {&lt;br /&gt;      if&amp;#40;next_byte_hi_lo&amp;#41; // high byte of short&lt;br /&gt;      {&lt;br /&gt;        next_pixel = &amp;#40;read_buffer&amp;#91;i&amp;#93; &amp;amp; 0xff&amp;#41; &amp;#60;&amp;#60; 8;&lt;br /&gt;        next_byte_hi_lo = 0;&lt;br /&gt;      }&lt;br /&gt;      else    // low byte of short&lt;br /&gt;      {&lt;br /&gt;        next_pixel |= &amp;#40;read_buffer&amp;#91;i&amp;#93; &amp;amp; 0xff&amp;#41;;&lt;br /&gt;        next_byte_hi_lo = 1;&lt;br /&gt;&lt;br /&gt;        // write the pixel to the frame buffer&lt;br /&gt;        *&amp;#40;uncached_buffer + &amp;#40;next_pixel_offset++&amp;#41;&amp;#41; = next_pixel;&lt;br /&gt;        &lt;br /&gt;        // wrap the pixel offset to the begining when we reach the end&lt;br /&gt;        if&amp;#40;next_pixel_offset == &amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41;&amp;#41;&lt;br /&gt;        {&lt;br /&gt;          next_pixel_offset = 0;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      read_cnt--;&lt;br /&gt;      i++;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  printf&amp;#40;&amp;#34;End of Program reached.&amp;#092;n&amp;#092;nExiting&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;  // technically, we should never get here&lt;br /&gt;  return&amp;#40;0&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void print_startup&amp;#40;void&amp;#41;    // this routine prints the menu out stdout&lt;br /&gt;{&lt;br /&gt;  printf&amp;#40;&amp;#34;&amp;#092;n&amp;#092;nIMAGE DOWNLOAD DEMO STARTED&amp;#092;n&amp;#092;n&amp;#34;&amp;#41;;&lt;br /&gt;  printf&amp;#40;&amp;#34;&amp;#092;&lt;br /&gt;This program is now waiting for binary image data to download thru the JTAG UART&amp;#092;n&amp;#092;&lt;br /&gt;&amp;#34;&amp;#41;;&lt;br /&gt;  fflush&amp;#40;stdout&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void clear_screen&amp;#40;void&amp;#41;    // this routine clears the main vga buffer RGB color gradients&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;  unsigned short *uncached_buffer;&lt;br /&gt;  &lt;br /&gt;  // make the frame buffer pointer uncached&lt;br /&gt;  uncached_buffer = &amp;#40;unsigned short *&amp;#41;&amp;#40;alt_remap_uncached&amp;#40; &amp;#40;void *&amp;#41;&amp;#40;main_frame_buffer&amp;#41;, &amp;#40;alt_u32&amp;#41;&amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41;&amp;#41;&amp;#41;;&lt;br /&gt;  &lt;br /&gt;  // fill the buffer with a red gradient&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;PIX_MAP_WIDTH*PIX_MAP_HEIGHT;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + i&amp;#41; = RED - &amp;#40;&amp;#40;i%32&amp;#41;&amp;#60;&amp;#60;11&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // fill the buffer 2/3 with a green gradient&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;PIX_MAP_WIDTH*PIX_MAP_HEIGHT*2/3;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + i&amp;#41; = GREEN - &amp;#40;&amp;#40;i%64&amp;#41;&amp;#60;&amp;#60;5&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // fill the buffer 1/3 with a blue gradient&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;PIX_MAP_WIDTH*PIX_MAP_HEIGHT/3;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + i&amp;#41; = BLUE - &amp;#40;&amp;#40;i%32&amp;#41;&amp;#60;&amp;#60;0&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void vga_dma_done&amp;#40;vga_dma_done_context *context&amp;#41;  // VGA DMA ISR&lt;br /&gt;{&lt;br /&gt;  // NOTE&amp;#58; calling alt_dma_txchan_send&amp;#40;&amp;#41; at ISR time like we do here is not recommended&lt;br /&gt;  // but since this is the only time we call this during normal execution, it&amp;#39;s not likely&lt;br /&gt;  // to cause any problems.  And since this demo doesn&amp;#39;t use an OS, it&amp;#39;s hard for us to&lt;br /&gt;  // make this happen in a timely fashion any other way.&lt;br /&gt;&lt;br /&gt;  // setup another dma to feed the frame buffer out the vga&lt;br /&gt;  alt_dma_txchan_send &amp;#40; tx_chan,&lt;br /&gt;                        &amp;#40;const void*&amp;#41;&amp;#40;context-&amp;#62;frame_buffer_base&amp;#41;,&lt;br /&gt;                        &amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41; * 2,&lt;br /&gt;                        &amp;#40;alt_txchan_done *&amp;#41;&amp;#40;vga_dma_done&amp;#41;,&lt;br /&gt;                        &amp;#40;void*&amp;#41;&amp;#40;context&amp;#41;&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void paint_marker&amp;#40;void&amp;#41;    // this routine paints a multicolor marker on the bottom right of the screen&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;  int end_of_line;&lt;br /&gt;  unsigned short *uncached_buffer;&lt;br /&gt;  &lt;br /&gt;  // make the frame buffer pointer uncached&lt;br /&gt;  uncached_buffer = &amp;#40;unsigned short *&amp;#41;&amp;#40;alt_remap_uncached&amp;#40; &amp;#40;void *&amp;#41;&amp;#40;main_frame_buffer&amp;#41;, &amp;#40;alt_u32&amp;#41;&amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41;&amp;#41;&amp;#41;;&lt;br /&gt;  &lt;br /&gt;  end_of_line = &amp;#40;PIX_MAP_WIDTH * PIX_MAP_HEIGHT&amp;#41; - 1;&lt;br /&gt;  &lt;br /&gt;  // draw a white line&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;5;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + &amp;#40;end_of_line - i&amp;#41;&amp;#41; = WHITE;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  end_of_line -= PIX_MAP_WIDTH;&lt;br /&gt;&lt;br /&gt;  // draw a red line&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;5;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + &amp;#40;end_of_line - i&amp;#41;&amp;#41; = RED;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  end_of_line -= PIX_MAP_WIDTH;&lt;br /&gt;&lt;br /&gt;  // draw a green line&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;5;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + &amp;#40;end_of_line - i&amp;#41;&amp;#41; = GREEN;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  end_of_line -= PIX_MAP_WIDTH;&lt;br /&gt;&lt;br /&gt;  // draw a blue line&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;5;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + &amp;#40;end_of_line - i&amp;#41;&amp;#41; = BLUE;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  end_of_line -= PIX_MAP_WIDTH;&lt;br /&gt;&lt;br /&gt;  // draw a black line&lt;br /&gt;  for &amp;#40;i=0;i&amp;#60;5;i++&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    *&amp;#40;uncached_buffer + &amp;#40;end_of_line - i&amp;#41;&amp;#41; = BLACK;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;To correct the problem, always follow this rule&amp;#58; use the return code from the read function to determine when you&amp;#39;ve hit EOF. Here is a revised edition of the same code, this time checking the return code from fgets&amp;#40;&amp;#41; to determine when the read fails. The code is exactly the same, except for the loop.&lt;br /&gt;&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62; &lt;br /&gt;#include &amp;#60;stdlib.h&amp;#62; &lt;br /&gt;&lt;br /&gt;#define MYFILE &amp;#34;junk1.txt&amp;#34; &lt;br /&gt;&lt;br /&gt;int main&amp;#40;void&amp;#41;&lt;br /&gt;{&lt;br /&gt;  FILE *fp;&lt;br /&gt;  char buf&amp;#91;BUFSIZ&amp;#93; = &amp;#34;Garbage&amp;#34;;&lt;br /&gt;  int i;&lt;br /&gt;  &lt;br /&gt;  if &amp;#40;&amp;#40;fp = fopen&amp;#40;MYFILE, &amp;#34;r&amp;#34;&amp;#41;&amp;#41; == NULL&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    perror &amp;#40;MYFILE&amp;#41;;&lt;br /&gt;    return &amp;#40;EXIT_FAILURE&amp;#41;;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  i = 0;&lt;br /&gt;&lt;br /&gt;  while &amp;#40;fgets&amp;#40;buf, sizeof&amp;#40;buf&amp;#41;, fp&amp;#41; &amp;#33;= NULL&amp;#41;&lt;br /&gt;  {&lt;br /&gt;    printf &amp;#40;&amp;#34;Line %4d&amp;#58; %s&amp;#34;, i, buf&amp;#41;;&lt;br /&gt;    i++;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  fclose&amp;#40;fp&amp;#41;;&lt;br /&gt;    &lt;br /&gt;  return&amp;#40;0&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;ANSI C&lt;br /&gt;&lt;br /&gt;If using ANSI C IO function calls you can set a UART HAL driver to operate in non-blocking mode using fcntl&amp;#40;&amp;#41;. To do this you need to reference fcntl.h and unistd.h in your source code. Then you can use fcntl&amp;#40;&amp;#41; to set the UART to non-blocking mode. Below is an example that sets the STDIN IO channel to operate in non-blocking mode&amp;#58;&lt;br /&gt;&lt;br /&gt;    fcntl&amp;#40;STDIN_FILENO, F_SETFL, O_NONBLOCK&amp;#41;;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;I open device uart in non blocking mode&amp;#58;&lt;br /&gt;&lt;br /&gt;static int fdterm; // FILEDESCRIPTOR RETURNED BY OPEN&lt;br /&gt;..&lt;br /&gt;fdterm = open&amp;#40;&amp;#34;/dev/uart1&amp;#34;, O_RDWR | O_NONBLOCK | O_NOCTTY&amp;#41;;&lt;br /&gt;..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;reading is done by&lt;br /&gt;&lt;br /&gt;..&lt;br /&gt;res=read&amp;#40;fdterm,uart1_tempbuff,sizeof&amp;#40;uart1_tempbuff&amp;#41;-1&amp;#41;;&lt;br /&gt;if&amp;#40;res&amp;#62;0&amp;#41; {&lt;br /&gt;... we have received some bytes&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;int uart_read&amp;#40;int base, char *ptr, int len, int flags&amp;#41;{&lt;br /&gt; &amp;nbsp; &amp;nbsp;int block;&lt;br /&gt; &amp;nbsp; &amp;nbsp;unsigned int status;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;block = 1;//&amp;#33;&amp;#40;flags &amp;amp; O_NONBLOCK&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp;do{&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status = IORD_ALTERA_AVALON_UART_STATUS&amp;#40;base&amp;#41;;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* clear any error flags */&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IOWR_ALTERA_AVALON_UART_STATUS&amp;#40;base, 0&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;#40;status &amp;amp; ALTERA_AVALON_UART_CONTROL_RRDY_MSK&amp;#41;{&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ptr&amp;#91;0&amp;#93; = IORD_ALTERA_AVALON_UART_RXDATA&amp;#40;base&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;#40;&amp;#33;&amp;#40;status &amp;amp; &amp;#40;ALTERA_AVALON_UART_STATUS_PE_MSK | &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ALTERA_AVALON_UART_STATUS_FE_MSK&amp;#41;&amp;#41;&amp;#41;{&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 1;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt; &amp;nbsp; &amp;nbsp;}while &amp;#40;block&amp;#41;;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;void&lt;br /&gt;get_weight_from_uart&amp;#40;char * weight&amp;#41;&lt;br /&gt;{&lt;br /&gt;FILE* fp;&lt;br /&gt;char in_char = 0;&lt;br /&gt;int pointer = 0;&lt;br /&gt;&lt;br /&gt;fp = fopen &amp;#40;&amp;#34;/dev/RS232&amp;#34;, &amp;#34;r+&amp;#34;&amp;#41;; //Open file for reading and writing&lt;br /&gt;if &amp;#40;fp ==0&amp;#41;&lt;br /&gt;{&lt;br /&gt;printf&amp;#40;&amp;#34;error&amp;#34;&amp;#41;;&lt;br /&gt;}&lt;br /&gt;if &amp;#40;fp&amp;#41;&lt;br /&gt;{&lt;br /&gt;while &amp;#40;1&amp;#41;&lt;br /&gt;{&lt;br /&gt;in_char = fgetc&amp;#40;fp&amp;#41;; // Get a character from the UART.&lt;br /&gt;if &amp;#40;&amp;#40;in_char == &amp;#39;&amp;#092;n&amp;#39;&amp;#41; | &amp;#40;in_char == &amp;#39;^&amp;#39;&amp;#41; | &amp;#40;in_char == 0&amp;#41;&amp;#41;&lt;br /&gt;{&lt;br /&gt;weight&amp;#91;pointer&amp;#93; = 0;&lt;br /&gt;fclose &amp;#40;fp&amp;#41;;&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;weight&amp;#91;pointer++&amp;#93; = in_char;&lt;br /&gt;// weight&amp;#91;pointer&amp;#93; = 0;&lt;br /&gt;// printf&amp;#40;weight&amp;#41;;&lt;br /&gt;// delay&amp;#40;1000&amp;#41;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;fclose &amp;#40;fp&amp;#41;;&lt;br /&gt;}&lt;br /&gt;// return 0;&lt;br /&gt;} &lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;#include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;#include &amp;#60;string.h&amp;#62;&lt;br /&gt;&lt;br /&gt;int main&amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt;FILE* fp;&lt;br /&gt;char prompt=0;&lt;br /&gt;&lt;br /&gt;fp = fopen&amp;#40;&amp;#34;/dev/uart1&amp;#34;, &amp;#34;w+&amp;#34;&amp;#41;;&lt;br /&gt;fprintf&amp;#40;fp,&amp;#34;AT+BTW0021D226A29E&amp;#91;B&amp;#93;&amp;#092;r&amp;#092;n&amp;#34;&amp;#91;/B&amp;#93;&amp;#41;;&lt;br /&gt;&lt;br /&gt;while&amp;#40;1&amp;#41;{&lt;br /&gt;prompt = getc&amp;#40;fp&amp;#41;;&lt;br /&gt;printf&amp;#40;&amp;#34;%c&amp;#34;, prompt&amp;#41;;&lt;br /&gt;}&lt;br /&gt;fclose&amp;#40;fp&amp;#41;;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;Hey,&lt;br /&gt;&lt;br /&gt;This is a function thats send one byte to the UART&lt;br /&gt;&lt;br /&gt;void UART1_T&amp;#40;unsigned char ch&amp;#41;&lt;br /&gt;{&lt;br /&gt;while&amp;#40;&amp;#40;IORD_ALTERA_AVALON_UART_STATUS&amp;#40;UART1_BASE&amp;#41; &amp;amp; 0x040&amp;#41; &amp;#33;= 0x040&amp;#41;{&amp;#59;}&lt;br /&gt;IOWR_ALTERA_AVALON_UART_TXDATA&amp;#40;UART1_BASE,ch&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You only have to change UART1_BASE address to your UART address that you can find back in your system.h file&lt;br /&gt;&lt;br /&gt;Good luck&lt;br /&gt;Regards&lt;br /&gt;Karel &lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;#include &amp;#34;altera_avalon_uart_regs.h&amp;#34;&lt;br /&gt;&lt;br /&gt;void endless_send&amp;#40;void&amp;#41;&lt;br /&gt;{&lt;br /&gt;unsigned char ch;&lt;br /&gt;unsigned int stat;&lt;br /&gt;&lt;br /&gt;/* make sure no IRQ enabled */&lt;br /&gt;IOWR&amp;#40;UART_BASE, 3, 0x00&amp;#41;;&lt;br /&gt;/* flush any characters sitting in the Rx holding register */&lt;br /&gt;i = IORD&amp;#40;UART_BASE, 0&amp;#41;;&lt;br /&gt;i = IORD&amp;#40;UART_BASE, 0&amp;#41;;&lt;br /&gt;&lt;br /&gt;ch = &amp;#39; &amp;#39;;&lt;br /&gt;for &amp;#40;;;&amp;#41; {&lt;br /&gt;/* get serial status */&lt;br /&gt;stat = IORD&amp;#40;UART_BASE, 2&amp;#41;;&lt;br /&gt;/* check for character Rx */&lt;br /&gt;if &amp;#40;stat &amp;amp; 0x0080&amp;#41; {&lt;br /&gt;/* if character is &amp;#39;1&amp;#39; then reset o/p character back to &amp;#39; &amp;#39; */&lt;br /&gt;if &amp;#40;IORD&amp;#40;UART_BASE, 0&amp;#41; == &amp;#39;1&amp;#39;&amp;#41; ch = &amp;#39; &amp;#39;;&lt;br /&gt;}&lt;br /&gt;/* check if able to Tx next character. */&lt;br /&gt;if &amp;#40;stat &amp;amp; 0x0040&amp;#41; {&lt;br /&gt;IOWR&amp;#40;UART_BASE, 1, ch&amp;#41;;&lt;br /&gt;/* increment character but keep in printable range */&lt;br /&gt;ch++;&lt;br /&gt;if &amp;#40;ch==0x80&amp;#41; ch = &amp;#39; &amp;#39;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;hi&lt;br /&gt;if somebody want to try uart device , i post a simple code that&amp;#39;s running&lt;br /&gt;of course it&amp;#39;s not complete but i would like to start a common little project&lt;br /&gt;with all people write in this community .&lt;br /&gt;&lt;br /&gt;#include &amp;#34;count_binary.h&amp;#34;&lt;br /&gt;&lt;br /&gt;int val;&lt;br /&gt;int uart_0;&lt;br /&gt;char buf&amp;#91;255&amp;#93;;&lt;br /&gt;alt_u8 counter;&lt;br /&gt;// REGISTER&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static void handle_uart_interrupt&amp;#40;void* context,alt_u32 id&amp;#41;&lt;br /&gt;{&lt;br /&gt;val++; //everytime i receive a caracter increment and display on leds&lt;br /&gt;Write_Output&amp;#40;val&amp;#41;;&lt;br /&gt;//using this macro automatically bit ready to receive will be resetted&lt;br /&gt;//and ready for a new interrupt when shifter register finish to translate last bit&lt;br /&gt;//in the uart device&lt;br /&gt;buf&amp;#91;counter&amp;#93;=IORD_ALTERA_AVALON_UART_RXDATA&amp;#40;UART_0_BASE&amp;#41;&amp;#59;&lt;br /&gt;counter++;&lt;br /&gt;if &amp;#40;counter==6&amp;#41;&lt;br /&gt;{printf&amp;#40;&amp;#34;riceived&amp;#58;%s&amp;#092;r &amp;#34;,buf&amp;#41;;&lt;br /&gt;counter=0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void Write_Output&amp;#40;alt_u8 val&amp;#41;&lt;br /&gt;{&lt;br /&gt;IOWR_ALTERA_AVALON_PIO_DATA&amp;#40;PM_OUT_BASE, val&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main&amp;#40;void&amp;#41;&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;volatile int uart_0;&lt;br /&gt;val=0;&lt;br /&gt;&lt;br /&gt;while&amp;#40; 1 &amp;#41;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;IOWR_ALTERA_AVALON_UART_CONTROL&amp;#40;UART_0_BASE, 0x180&amp;#41;;&lt;br /&gt;alt_irq_register&amp;#40;UART_0_IRQ,&amp;amp;uart_0,handle_uart_interrupt&amp;#41;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return&amp;#40;0&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;C Example&amp;#58; Sending &amp;#34;Hello World&amp;#34; through the UART&lt;br /&gt;&lt;br /&gt;#define RS232_UART_RX &amp;#40;&amp;#40;volatile char*&amp;#41; &amp;nbsp;0xff1000&amp;#41;&lt;br /&gt;#define RS232_UART_TX &amp;#40;&amp;#40;volatile char*&amp;#41; &amp;nbsp;&amp;#40;0xff1000+4&amp;#41;&amp;#41;&lt;br /&gt;#define RS232_UART_STATUS &amp;#40;&amp;#40;volatile char*&amp;#41; &amp;nbsp;&amp;#40;0xff1000+8&amp;#41;&amp;#41;&lt;br /&gt;&lt;br /&gt;int main&amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt; &amp;nbsp; &amp;nbsp;unsigned char hwld&amp;#91;&amp;#93; = {&amp;#39;H&amp;#39;,&amp;#39;e&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39; &amp;#39;,&amp;#39;W&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39;r&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;d&amp;#39;,&amp;#39;&amp;#092;0&amp;#39;};&lt;br /&gt; &amp;nbsp; &amp;nbsp;unsigned char *pOutput;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;pOutput = hwld;&lt;br /&gt; &amp;nbsp; &amp;nbsp;while&amp;#40;*pOutput&amp;#41; //strings in C are zero terminated&lt;br /&gt; &amp;nbsp; &amp;nbsp;{&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //if room in output buffer&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;&amp;#40;*RS232_UART_STATUS &amp;#41;&amp;amp;0x40 &amp;nbsp;&amp;#41; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//then write the next character&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*RS232_UART_TX = &amp;#40;*pOutput++&amp;#41;; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Thu, 23 Jul 2009 15:19:55 +0800</pubDate>
        </item>
        <item>
            <title>guys what part time work can i work</title>
            <link>http://forum.lowyat.net/topic/1093456</link>
            <description>please help me... need money... please&lt;br /&gt;&lt;br /&gt;&lt;span style='color:transparent'&gt;i will revenge whomever posted sarcastically&lt;/span&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 12 Jul 2009 02:00:23 +0800</pubDate>
        </item>
        <item>
            <title>where can i buy the Guy Fawkes mask..</title>
            <link>http://forum.lowyat.net/topic/1092431</link>
            <description>&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;01&amp;#58; /*&lt;br /&gt;02&amp;#58; &amp;nbsp;* PIO test&lt;br /&gt;03&amp;#58; &amp;nbsp;*&lt;br /&gt;04&amp;#58; &amp;nbsp;*/&lt;br /&gt;05&amp;#58; &lt;br /&gt;06&amp;#58; #include &amp;#60;stdio.h&amp;#62;&lt;br /&gt;07&amp;#58; #include &amp;#60;unistd.h&amp;#62;&lt;br /&gt;08&amp;#58; #include &amp;#34;system.h&amp;#34;&lt;br /&gt;09&amp;#58; #include &amp;#34;altera_avalon_pio_regs.h&amp;#34;&lt;br /&gt;10&amp;#58; #include &amp;#34;sys/alt_irq.h&amp;#34;&lt;br /&gt;11&amp;#58; &amp;nbsp;&lt;br /&gt;12&amp;#58; &amp;nbsp;int n = 0;&lt;br /&gt;13&amp;#58; &amp;nbsp;/* A variable to hold the value of the button pio edge capture register. */&lt;br /&gt;14&amp;#58; volatile int edge_capture;&lt;br /&gt;15&amp;#58; &lt;br /&gt;16&amp;#58; void init_pio&amp;#40;&amp;#41;;&lt;br /&gt;17&amp;#58; &amp;nbsp;&lt;br /&gt;18&amp;#58; int main&amp;#40;&amp;#41;&lt;br /&gt;19&amp;#58; {&lt;br /&gt;20&amp;#58; &amp;nbsp; &amp;nbsp; n = 0;&lt;br /&gt;21&amp;#58; &amp;nbsp; &amp;nbsp; init_pio&amp;#40;&amp;#41;;&lt;br /&gt;22&amp;#58; &amp;nbsp; &amp;nbsp; while &amp;#40;1&amp;#41; {&lt;br /&gt;23&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IOWR_ALTERA_AVALON_PIO_DATA&amp;#40;PIO_BASE, n&amp;#41;;&lt;br /&gt;24&amp;#58; &amp;nbsp; }&lt;br /&gt;25&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;26&amp;#58; &amp;nbsp; &amp;nbsp; return 0;&lt;br /&gt;27&amp;#58; }&lt;br /&gt;28&amp;#58; &amp;nbsp;&lt;br /&gt;29&amp;#58; &amp;nbsp;/*******************************************************************&lt;br /&gt;30&amp;#58; &amp;nbsp;* static void handle_button_interrupts&amp;#40; void* context, alt_u32 id&amp;#41;*&lt;br /&gt;31&amp;#58; &amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * &amp;nbsp;&lt;br /&gt;32&amp;#58; &amp;nbsp;* Handle interrupts from the buttons. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;br /&gt;33&amp;#58; &amp;nbsp;* This interrupt event is triggered by a button/switch press. &amp;nbsp; &amp;nbsp; *&lt;br /&gt;34&amp;#58; &amp;nbsp;* This handler sets *context to the value read from the button &amp;nbsp; &amp;nbsp;*&lt;br /&gt;35&amp;#58; &amp;nbsp;* edge capture register. &amp;nbsp;The button edge capture register &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;br /&gt;36&amp;#58; &amp;nbsp;* is then cleared and normal program execution resumes. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;br /&gt;37&amp;#58; &amp;nbsp;* The value stored in *context is used to control program flow &amp;nbsp; &amp;nbsp;*&lt;br /&gt;38&amp;#58; &amp;nbsp;* in the rest of this program&amp;#39;s routines. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;br /&gt;39&amp;#58; &amp;nbsp;******************************************************************/&lt;br /&gt;40&amp;#58; &lt;br /&gt;41&amp;#58; void handle_button_interrupts&amp;#40;void* context, alt_u32 id&amp;#41;&lt;br /&gt;42&amp;#58; {&lt;br /&gt;43&amp;#58; &amp;nbsp; &amp;nbsp; /* Cast context to edge_capture&amp;#39;s type. It is important that this be &lt;br /&gt;44&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp;* declared volatile to avoid unwanted compiler optimization.&lt;br /&gt;45&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;46&amp;#58; &amp;nbsp; &amp;nbsp; volatile int* edge_capture_ptr = &amp;#40;volatile int*&amp;#41; context;&lt;br /&gt;47&amp;#58; &amp;nbsp; &amp;nbsp; /* Store the value in the Button&amp;#39;s edge capture register in *context. */&lt;br /&gt;48&amp;#58; &amp;nbsp; &amp;nbsp; *edge_capture_ptr = IORD_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;PIO_BASE&amp;#41;;&lt;br /&gt;49&amp;#58; &amp;nbsp; &amp;nbsp; n++;&lt;br /&gt;50&amp;#58; &amp;nbsp; &amp;nbsp; /* Reset the Button&amp;#39;s edge capture register. */&lt;br /&gt;51&amp;#58; &amp;nbsp; &amp;nbsp; IOWR_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;PIO_BASE, 0&amp;#41;;&lt;br /&gt;52&amp;#58; }&lt;br /&gt;53&amp;#58; &lt;br /&gt;54&amp;#58; /* Initialize the pio. */&lt;br /&gt;55&amp;#58; &lt;br /&gt;56&amp;#58; void init_pio&amp;#40;&amp;#41;&lt;br /&gt;57&amp;#58; {&lt;br /&gt;58&amp;#58; &amp;nbsp; &amp;nbsp; /* Recast the edge_capture pointer to match the alt_irq_register&amp;#40;&amp;#41; function&lt;br /&gt;59&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp;* prototype. */&lt;br /&gt;60&amp;#58; &amp;nbsp; &amp;nbsp; void* edge_capture_ptr = &amp;#40;void*&amp;#41; &amp;amp;edge_capture;&lt;br /&gt;61&amp;#58; &amp;nbsp; &amp;nbsp; /* Enable first four interrupts. */&lt;br /&gt;62&amp;#58; &amp;nbsp; &amp;nbsp; IOWR_ALTERA_AVALON_PIO_IRQ_MASK&amp;#40;PIO_BASE, 0xf&amp;#41;;&lt;br /&gt;63&amp;#58; &amp;nbsp; &amp;nbsp; /* Reset the edge capture register. */&lt;br /&gt;64&amp;#58; &amp;nbsp; &amp;nbsp; IOWR_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;PIO_BASE, 0x0&amp;#41;;&lt;br /&gt;65&amp;#58; &amp;nbsp; &amp;nbsp; /* Register the interrupt handler. */&lt;br /&gt;66&amp;#58; &amp;nbsp; &amp;nbsp; alt_irq_register&amp;#40; PIO_IRQ, edge_capture_ptr,&lt;br /&gt;67&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; handle_button_interrupts &amp;#41;;&lt;br /&gt;68&amp;#58; }&lt;br /&gt;69&amp;#58; &lt;br /&gt;70&amp;#58; &lt;br /&gt;71&amp;#58; #if defined&amp;#40;MAIN1&amp;#41;&lt;br /&gt;72&amp;#58; int main&amp;#40;&amp;#41;&lt;br /&gt;73&amp;#58; {&lt;br /&gt;74&amp;#58; &amp;nbsp; volatile int in, &amp;nbsp;out;&lt;br /&gt;75&amp;#58; &amp;nbsp; while &amp;#40;1&amp;#41; &lt;br /&gt;76&amp;#58; &amp;nbsp; {&lt;br /&gt;77&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; in = IORD_ALTERA_AVALON_PIO_DATA&amp;#40;PIO_BASE&amp;#41;;&lt;br /&gt;78&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; out = in;&lt;br /&gt;79&amp;#58; &amp;nbsp; &amp;nbsp; &amp;nbsp; IOWR_ALTERA_AVALON_PIO_DATA&amp;#40;PIO_BASE, out&amp;#41;;&lt;br /&gt;80&amp;#58; &amp;nbsp; }&lt;br /&gt;81&amp;#58; &amp;nbsp;}&lt;br /&gt;82&amp;#58; &amp;nbsp;#endif&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;FILE * lcd;&lt;br /&gt;&lt;br /&gt;void handleJTAGInterrupt &amp;#40;void* context, alt_u32 id&amp;#41;&lt;br /&gt;{&lt;br /&gt; &amp;nbsp; &amp;nbsp;unsigned int controlRegister;&lt;br /&gt; &amp;nbsp; &amp;nbsp;&lt;br /&gt; &amp;nbsp; &amp;nbsp;controlRegister = IORD_ALTERA_AVALON_JTAG_UART_CONTROL&amp;#40;JTAG_UART_BASE&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp;fprintf&amp;#40;lcd, &amp;#34;&amp;#092;r%8X&amp;#34;, controlRegister&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main &amp;#40;void&amp;#41;&lt;br /&gt;{&lt;br /&gt; &amp;nbsp; &amp;nbsp;IOWR_ALTERA_AVALON_JTAG_UART_CONTROL&amp;#40;JTAG_UART_BASE, 0x01&amp;#41;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Active the read interrupt on JTAG&lt;br /&gt; &amp;nbsp; &amp;nbsp;alt_irq_register&amp;#40;JTAG_UART_IRQ, 0, handleJTAGInterrupt&amp;#41;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Register the ISR for JTAG&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;IOWR_ALTERA_AVALON_PIO_DATA&amp;#40;LED_PIO_BASE, 0xEE&amp;#41;;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;lcd = fopen&amp;#40;&amp;#34;/dev/lcd&amp;#34;, &amp;#34;w&amp;#34;&amp;#41;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Open the LCD device&lt;br /&gt; &amp;nbsp; &amp;nbsp;printf&amp;#40;&amp;#34;test&amp;#092;n&amp;#34;&amp;#41;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Display text on computer &amp;#40;Nios II IDE console&amp;#41;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp;while&amp;#40;1&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;C Example&lt;br /&gt;&lt;br /&gt;The following code illustrates an ISR that services an interrupt from a button PIO. This example is based on a Nios II system with a 4-bit PIO peripheral connected to push-buttons. An IRQ is generated any time a button is pushed. The ISR code reads the PIO peripheral’s edge-capture register and stores the value to a global variable. The address of the global variable is passed to the ISR via the context pointer. Example&amp;#58; An ISR to Service a Button PIO IRQ&lt;br /&gt;&lt;br /&gt;#include &amp;#34;system.h&amp;#34;&lt;br /&gt;#include &amp;#34;altera_avalon_pio_regs.h&amp;#34;&lt;br /&gt;#include &amp;#34;alt_types.h&amp;#34;&lt;br /&gt;static void handle_button_interrupts&amp;#40;void* context, alt_u32 id&amp;#41;&lt;br /&gt;{&lt;br /&gt;/* cast the context pointer to an integer pointer. */&lt;br /&gt;volatile int* edge_capture_ptr = &amp;#40;volatile int*&amp;#41; context;&lt;br /&gt;/*&lt;br /&gt;* Read the edge capture register on the button PIO.&lt;br /&gt;* Store value.&lt;br /&gt;*/&lt;br /&gt;*edge_capture_ptr =&lt;br /&gt;IORD_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;BUTTON_PIO_BASE&amp;#41;;&lt;br /&gt;/* Write to the edge capture register to reset it. */&lt;br /&gt;IOWR_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;BUTTON_PIO_BASE, 0&amp;#41;;&lt;br /&gt;/* reset interrupt capability for the Button PIO. */&lt;br /&gt;IOWR_ALTERA_AVALON_PIO_IRQ_MASK&amp;#40;BUTTON_PIO_BASE, 0xf&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The following code shows an example of the code for the main program that registers the ISR with the HAL.&lt;br /&gt;Example&amp;#58; Registering the Button PIO ISR with the HAL&lt;br /&gt;&lt;br /&gt;#include &amp;#34;sys/alt_irq.h&amp;#34;&lt;br /&gt;#include &amp;#34;system.h&amp;#34;&lt;br /&gt;...&lt;br /&gt;/* Declare a global variable to hold the edge capture value. */&lt;br /&gt;volatile int edge_capture;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;/* Initialize the button_pio. */&lt;br /&gt;static void init_button_pio&amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt;/* Recast the edge_capture pointer to match the&lt;br /&gt;alt_irq_register&amp;#40;&amp;#41; function prototype. */&lt;br /&gt;void* edge_capture_ptr = &amp;#40;void*&amp;#41; &amp;amp;edge_capture;&lt;br /&gt;/* Enable all 4 button interrupts. */&lt;br /&gt;IOWR_ALTERA_AVALON_PIO_IRQ_MASK&amp;#40;BUTTON_PIO_BASE, 0xf&amp;#41;;&lt;br /&gt;/* Reset the edge capture register. */&lt;br /&gt;IOWR_ALTERA_AVALON_PIO_EDGE_CAP&amp;#40;BUTTON_PIO_BASE, 0x0&amp;#41;;&lt;br /&gt;/* Register the ISR. */&lt;br /&gt;alt_irq_register&amp;#40; BUTTON_PIO_IRQ,&lt;br /&gt;edge_capture_ptr,&lt;br /&gt;handle_button_interrupts &amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Based on this code, the following execution flow is possible&amp;#58;&lt;br /&gt;&lt;br /&gt; &amp;nbsp; 1. Button is pressed, generating an IRQ.&lt;br /&gt; &amp;nbsp; 2. The HAL exception handler is invoked and dispatches the handle_button_interrupts&amp;#40;&amp;#41; ISR.&lt;br /&gt; &amp;nbsp; 3. handle_button_interrupts&amp;#40;&amp;#41; services the interrupt and returns.&lt;br /&gt; &amp;nbsp; 4. Normal program operation continues with an updated value of edge_capture.&lt;br /&gt; &lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sat, 11 Jul 2009 07:50:24 +0800</pubDate>
        </item>
        <item>
            <title>So Firedauz is really...</title>
            <link>http://forum.lowyat.net/topic/1092339</link>
            <description>plus he is a lecturer&lt;br /&gt;&lt;br /&gt;Gua respect u....</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sat, 11 Jul 2009 01:24:37 +0800</pubDate>
        </item>
        <item>
            <title>when would we talk like this....</title>
            <link>http://forum.lowyat.net/topic/1091476</link>
            <description>&lt;b&gt;&lt;span style='color:red'&gt;&lt;span style='font-family:Arial'&gt;&lt;!--QuoteBegin--&gt;&lt;div class='quotetop'&gt;QUOTE&lt;/div&gt;&lt;div class='quotemain'&gt;&lt;!--QuoteEBegin--&gt;The Architect - Hello, Neo.&lt;br /&gt;&lt;br /&gt;Neo - Who are you?&lt;br /&gt;&lt;br /&gt;The Architect - I am the Architect. I created the matrix. I&amp;#39;ve been waiting for you. You have many questions, and although the process has altered your consciousness, you remain irrevocably human. Ergo, some of my answers you will understand, and some of them you will not. Concordantly, while your first question may be the most pertinent, you may or may not realize it is also irrelevant.&lt;br /&gt;&lt;br /&gt;Neo - Why am I here?&lt;br /&gt;&lt;br /&gt;The Architect - Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix. You are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision. While it remains a burden to sedulously avoid it, it is not unexpected, and thus not beyond a measure of control. Which has led you, inexorably, here.&lt;br /&gt;&lt;br /&gt;Neo - You haven&amp;#39;t answered my question.&lt;br /&gt;&lt;br /&gt;The Architect - Quite right. Interesting. That was quicker than the others.&lt;br /&gt;&lt;br /&gt;*The responses of the other Ones appear on the monitors: &amp;quot;Others? What others? How many? Answer me&amp;#33;&amp;quot;*&lt;br /&gt;(Neo1980: I don&amp;#39;t agree with whoever wrote this, I think that the monitors are showing Neo&amp;#39;s possible answers, possible hinting that there are alternatives to his actions and hence the choice issue comes up. Also, the camera zooms in on Neo&amp;#39;s current response, showing the choice made.)&lt;br /&gt;&lt;br /&gt;The Architect - The matrix is older than you know. I prefer counting from the emergence of one integral anomaly to the emergence of the next, in which case this is the sixth version.&lt;br /&gt;&lt;br /&gt;*Again, the responses of the other Ones appear on the monitors: &amp;quot;Five versions? Three? I&amp;#39;ve been lied too. This is bull****.&amp;quot;*&lt;br /&gt;&lt;br /&gt;Neo: There are only two possible explanations: either no one told me, or no one knows.&lt;br /&gt;&lt;br /&gt;The Architect - Precisely. As you are undoubtedly gathering, the anomaly&amp;#39;s systemic, creating fluctuations in even the most simplistic equations.&lt;br /&gt;&lt;br /&gt;*Once again, the responses of the other Ones appear on the monitors: &amp;quot;You can&amp;#39;t control me&amp;#33; **** you&amp;#33; I&amp;#39;m going to kill you&amp;#33; You can&amp;#39;t make me do anything&amp;#33;*&lt;br /&gt;&lt;br /&gt;Neo - Choice. The problem is choice.&lt;br /&gt;&lt;br /&gt;*The scene cuts to Trinity fighting an agent, and then back to the Architects room*&lt;br /&gt;&lt;br /&gt;The Architect - The first matrix I designed was quite naturally perfect, it was a work of art, flawless, sublime. A triumph equaled only by its monumental failure. The inevitability of its doom is as apparent to me now as a consequence of the imperfection inherent in every human being, thus I redesigned it based on your history to more accurately reflect the varying grotesqueries of your nature. However, I was again frustrated by failure. I have since come to understand that the answer eluded me because it required a lesser mind, or perhaps a mind less bound by the parameters of perfection. Thus, the answer was stumbled upon by another, an intuitive program, initially created to investigate certain aspects of the human psyche. If I am the father of the matrix, she would undoubtedly be its mother.&lt;br /&gt;&lt;br /&gt;Neo - The Oracle.&lt;br /&gt;&lt;br /&gt;The Architect - Please. As I was saying, she stumbled upon a solution whereby nearly 99.9% of all test subjects accepted the program, as long as they were given a choice, even if they were only aware of the choice at a near unconscious level. While this answer functioned, it was obviously fundamentally flawed, thus creating the otherwise contradictory systemic anomaly, that if left unchecked might threaten the system itself. Ergo, those that refused the program, while a minority, if unchecked, would constitute an escalating probability of disaster.&lt;br /&gt;&lt;br /&gt;Neo - This is about Zion.&lt;br /&gt;&lt;br /&gt;The Architect - You are here because Zion is about to be destroyed. Its every living inhabitant terminated, its entire existence eradicated.&lt;br /&gt;&lt;br /&gt;Neo - Bull****.&lt;br /&gt;&lt;br /&gt;*The responses of the other Ones appear on the monitors: &amp;quot;Bull****&amp;#33;&amp;quot;*&lt;br /&gt;&lt;br /&gt;The Architect - Denial is the most predictable of all human responses. But, rest assured, this will be the sixth time we have destroyed it, and we have become exceedingly efficient at it.&lt;br /&gt;&lt;br /&gt;*Scene cuts to Trinity fighting an agent, and then back to the Architects room.*&lt;br /&gt;&lt;br /&gt;The Architect - The function of the One is now to return to the source, allowing a temporary dissemination of the code you carry, reinserting the prime program. After which you will be required to select from the matrix 23 individuals, 16 female, 7 male, to rebuild Zion. Failure to comply with this process will result in a cataclysmic system crash killing everyone connected to the matrix, which coupled with the extermination of Zion will ultimately result in the extinction of the entire human race.&lt;br /&gt;&lt;br /&gt;Neo - You won&amp;#39;t let it happen, you can&amp;#39;t. You need human beings to survive.&lt;br /&gt;&lt;br /&gt;The Architect - There are levels of survival we are prepared to accept. However, the relevant issue is whether or not you are ready to accept the responsibility for the death of every human being in this world.&lt;br /&gt;&lt;br /&gt;*The Architect presses a button on a pen that he is holding, and images of people from all over the matrix appear on the monitors*&lt;br /&gt;&lt;br /&gt;The Architect - It is interesting reading your reactions. Your five predecessors were by design based on a similar predication, a contingent affirmation that was meant to create a profound attachment to the rest of your species, facilitating the function of the one. While the others experienced this in a very general way, your experience is far more specific. Vis-a-vis, love.&lt;br /&gt;&lt;br /&gt;*Images of Trinity fighting the agent from Neo&amp;#39;s dream appear on the monitors*&lt;br /&gt;&lt;br /&gt;Neo - Trinity.&lt;br /&gt;&lt;br /&gt;The Architect - Apropos, she entered the matrix to save your life at the cost of her own.&lt;br /&gt;&lt;br /&gt;Neo - No&amp;#33;&lt;br /&gt;&lt;br /&gt;The Architect - Which brings us at last to the moment of truth, wherein the fundamental flaw is ultimately expressed, and the anomaly revealed as both beginning, and end. There are two doors. The door to your right leads to the source, and the salvation of Zion. The door to the left leads back to the matrix, to her, and to the end of your species. As you adequately put, the problem is choice. But we already know what you&amp;#39;re going to do, don&amp;#39;t we? Already I can see the chain reaction, the chemical precursors that signal the onset of emotion, designed specifically to overwhelm logic, and reason. An emotion that is already blinding you from the simple, and obvious truth: she is going to die, and there is nothing that you can do to stop it.&lt;br /&gt;&lt;br /&gt;*Neo walks to the door on his left*&lt;br /&gt;&lt;br /&gt;The Architect - Humph. Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness.&lt;br /&gt;&lt;br /&gt;Neo - If I were you, I would hope that we don&amp;#39;t meet again.&lt;br /&gt;&lt;br /&gt;The Architect - We won&amp;#39;t.&lt;!--QuoteEnd--&gt;&lt;/div&gt;&lt;!--QuoteEEnd--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Fri, 10 Jul 2009 13:00:24 +0800</pubDate>
        </item>
        <item>
            <title>there are many jokers in kopitiam....</title>
            <link>http://forum.lowyat.net/topic/1091415</link>
            <description>lol... thank you for your witty yet fast replies....&lt;br /&gt;&lt;br /&gt;seriously guys there are some of them who really funneh..... &lt;!--emo&amp;:clap:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxms.gif' border='0' style='vertical-align:middle' alt='rclxms.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:clap:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxms.gif' border='0' style='vertical-align:middle' alt='rclxms.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Fri, 10 Jul 2009 12:01:55 +0800</pubDate>
        </item>
        <item>
            <title>Found a girl</title>
            <link>http://forum.lowyat.net/topic/1090066</link>
            <description>otherwise she would be perfect...wat to do...&lt;br /&gt;&lt;br /&gt;i mean i want her but i dont want her to be someone she is not either</description>
            <author>greenwire85</author>
            <category>Cupid&amp;#39;s Corner</category>
            <pubDate>Thu, 09 Jul 2009 08:39:57 +0800</pubDate>
        </item>
        <item>
            <title>what would you do today?</title>
            <link>http://forum.lowyat.net/topic/1086393</link>
            <description>please state what you would be doing today and let see if that is the case at the end of the day.....&lt;br /&gt;&lt;br /&gt;me:&lt;br /&gt;&lt;br /&gt;meet lecturer</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Mon, 06 Jul 2009 03:34:35 +0800</pubDate>
        </item>
        <item>
            <title>Tecmo Koei CEO to Sony</title>
            <link>http://forum.lowyat.net/topic/1085233</link>
            <description>Activision&amp;#39;s CEO has already gone public with his complaints about the price of the PS3, and it looks he&amp;#39;s not alone among industry bigwigs with a bone to pick with Sony, with the CEO of the newly formed Tecmo Koei now coming out and echoing his concerns. Speaking with CVG, Tecmo Koei&amp;#39;s Kenji Matsubara says that whenever he speaks about the issue with Sony reps, he asks them to &amp;quot;please cut the price&amp;quot; of the PS3, adding that &amp;quot;from a publisher&amp;#39;s point of view we would welcome a price cut for PS3 and we are waiting, definitely.&amp;quot; He doesn&amp;#39;t quite go so far as pull an Activision and threaten to ditch support for the console if Sony doesn&amp;#39;t drop the price, however, although it seems safe to assume that these complains will only grow louder -- at least until Sony actually does cut the price of the PS3, that is.&lt;br /&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 05 Jul 2009 01:21:21 +0800</pubDate>
        </item>
        <item>
            <title>Spanish club unveil their lowest-profile ‘galactic</title>
            <link>http://forum.lowyat.net/topic/1085227</link>
            <description>&lt;br /&gt;&lt;br /&gt;MADRID: Several thousand fans gave new Real Madrid signing Raul Albiol a hearty welcome as the Spanish powerhouse presented their lowest-profile signing of the new “galactico” era on Thursday.&lt;br /&gt;&lt;br /&gt;The Spain international, who signed a five-year contract last month after being acquired from Valencia for �15mil (US&amp;#036;21mil), looked overwhelmed by the welcome at Santiago Bernabeu Stadium – two days after 50,000 fans greeted Kaka.&lt;br /&gt;&lt;br /&gt;“I don’t have to say that I’m very happy to be here. It comes with great pride to be welcomed like that,” a grinning Albiol said. “I’ll give my maximum. I’ll give all I can so the team can win titles.”&lt;br /&gt;&lt;br /&gt;Younger fans packed the north stand after Madrid offered a free tour of the stadium’s museum to children under 14 years to attract more spectators to the presentation.&lt;br /&gt;&lt;br /&gt;Madrid have spent �214mil (US&amp;#036;300mil) on players this summer. President Florentino Perez has also signed AC Milan’s Kaka, Manchester United winger Cristiano Ronaldo and Lyon striker Karim Benzema as part of his re-modeling plans along the “galactico” model he created during his first tenure from 2000-06.&lt;br /&gt;&lt;br /&gt;“Sharing the locker room with two world renown players is an honour,” Albiol said. “And all the other players, too. I’m very motivated and excited for the season to start.”&lt;br /&gt;&lt;br /&gt;The 80,000-capacity stadium is expected to be full for Ronaldo’s presentation on Monday.&lt;br /&gt;&lt;br /&gt;The 23-year-old Albiol arrives after five seasons at Valencia, where he scored seven goals in 173 appearances. Albiol, who also spent a season at Getafe, was a regular in helping Valencia win the 2008 Copa del Rey.&lt;br /&gt;&lt;br /&gt;Albiol was also a member of Spain’s European Championship-winning team last summer and had just returned from the Confederations Cup in South Africa.&lt;br /&gt;&lt;br /&gt;“It’s a responsibility that I’m right to assume,” Albiol said of being a Spanish presence on a team filled with international stars.&lt;br /&gt;&lt;br /&gt;Albiol is the first major Spanish signing by Perez, who has vowed to restore Madrid as the world’s most important club following a season marred by off-field problems, with his predecessor Ramon Calderon eventually resigning over a vote-rigging scandal.&lt;br /&gt;&lt;br /&gt;“We are building a team that can continue realising all of your dreams,” Perez told the crowd. — AP&lt;br /&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 05 Jul 2009 01:16:44 +0800</pubDate>
        </item>
        <item>
            <title>Owen joins Red Devils</title>
            <link>http://forum.lowyat.net/topic/1085222</link>
            <description>MANCHESTER: Michael Owen has joined English champions Manchester United on a two-year contract, the club announced yesterday.&lt;br /&gt;&lt;br /&gt;Injury-prone England striker Owen, 29, a free agent after his Newcastle contract expired at the end of last month, underwent a medical at a Manchester hospital yesterday before returning to United’s Carrington training ground to complete the shock deal.&lt;br /&gt;&lt;br /&gt;The move came after the only clubs interested in signing the former Liverpool and Real Madrid striker appeared to be Stoke and Hull — both Premier League sides but teams for whom staying up was an achievement in itself.&lt;br /&gt;&lt;br /&gt;But United manager Sir Alex Ferguson said signing Owen did not represent a gamble on his part.&lt;br /&gt;&lt;br /&gt;“Michael is a world class forward with a proven goalscoring record at the highest level and that has never been in question,” said Ferguson.&lt;br /&gt;&lt;br /&gt;“Coming to Manchester United with the expectations that we have is something that Michael will relish.”&lt;br /&gt;&lt;br /&gt;It has been reported that Ferguson has signed a pay as you play deal.&lt;br /&gt;&lt;br /&gt;Owen, who scored just 10 goals for the Magpies as they were relegated from the Premier League last season, said he’d been as stunned as anyone by United’s interest in him.&lt;br /&gt;&lt;br /&gt;“I had just begun to talk to other clubs when out of the blue Sir Alex phoned me on Wednesday, invited me to have breakfast with him next morning during which he told me that he wanted to sign me,” he said.&lt;br /&gt;&lt;br /&gt;“I agreed without a moment’s thought. This is a fantastic opportunity for me and I intend to seize it with both hands.” — ASFP</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 05 Jul 2009 01:14:01 +0800</pubDate>
        </item>
        <item>
            <title>BMW introduces the X1</title>
            <link>http://forum.lowyat.net/topic/1085221</link>
            <description>BMW has announced details of its X1, with the latest derivative of its X model line-up slated for introduction into the market later in the year.&lt;br /&gt;&lt;br /&gt;The five-seat SAV - which will be built in Liepzig, Germany - will be offered in Europe with a choice of one six-cylinder petrol engine and three four-cylinder diesels.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The baby X arrives&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From the front, the 4.45m-long X1 retains typical BMW X features with a &amp;quot;three-eye-look&amp;quot; and elevated fog lamps. The kidney grille is upright, the short hood is deeply sculpted and the rear lights are a reinterpretation of the typical BMW L-shape. The wheelhouses are squared and a steeply raked rear window highlights the car�s sporting appeal. The &amp;quot;Hofmeister kick&amp;quot; is also evident at the base of the C-pillar.&lt;br /&gt;&lt;br /&gt;Inside, you get an elevated seating position as well as a generous feeling of space, and to underline the functionality of the vehicle, there are a wide range of storage options, including boxes, trays and cup holders on the centre console as well as large open door compartments with integrated holders for bottles.&lt;br /&gt;&lt;br /&gt;The rear-seat backrest is adjustable for angle and folds down in a 40/20/40 split, and luggage capacity can be increased from 420l to 1,350l with the rear seats folded down.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Nothing too different here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The X1&amp;#39;s interior can be further enhanced by opting for a new Design package, which sees Sport seats in Oyster Nevada leather, Anthracite headlining and Fineline Wave wood trim, with the Oyster theme continuing to the lower part of the dashboard, all of the centre console and leather piping on the floor mats.&lt;br /&gt;&lt;br /&gt;The European range will kick off with the sDrive18d, with rear-wheel drive, as well as the xDrive18d, both powered by a 143bhp 2.0l turbocharged diesel block offering 320Nm of torque.&lt;br /&gt;&lt;br /&gt;Next are the sDrive20d and xDrive20d models, powered by the same 2.0l unit but in a higher state of tune, at 177hp and 350Nm from 1,750rpm-3,000rpm. The diesel lineup is topped by the xDrive23d, which offers 204bhp and 400Nm of torque from its twin-turbo 2.0l pot.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Curvier than its siblings.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The sole petrol variant is the xDrive28i, and the 3.0l straight-six-equipped model turns out 255bhp and 310Nm as well as a 6.8sec 0-100kmh time for figures.&lt;br /&gt;&lt;br /&gt;Lower down the line, the primary drivetrain choice will be a six-speed manual, and as far as the auto route goes, there&amp;#39;s a six-speed Sport tranny in the mix.&lt;br /&gt;&lt;br /&gt;Standard safety features include three-point inertia-reel seat belts all round, frontal and side airbags as well as head airbags at the side, adaptive Brake Lights and daytime driving lights.</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 05 Jul 2009 01:13:03 +0800</pubDate>
        </item>
        <item>
            <title>S.Korea says N.Korea fires 7 missiles</title>
            <link>http://forum.lowyat.net/topic/1085220</link>
            <description>&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;S.Korea says N.Korea fires 7 missiles off east coast &amp;#40;Updated&amp;#41;&lt;br /&gt;&lt;br /&gt;SEOUL, South Korea &amp;#40;AP&amp;#41;&amp;#58; North Korea fired seven ballistic missiles off its eastern coast Saturday, South Korea said, a violation of U.N. resolutions and an apparent message of defiance to the United States on its Independence Day.&lt;br /&gt;&lt;br /&gt;The launches, which came two days after North Korea fired four short-range cruise missiles, will likely further escalate tensions in the region as the U.S. tries to muster support for tough enforcement of the latest U.N. Security Council resolution imposed on the communist regime for its May nuclear test.&lt;br /&gt;&lt;br /&gt;South Korea&amp;#39;s Joint Chiefs of Staff said three missiles were fired early Saturday, a fourth around noon and three more in the afternoon. The Defense Ministry said that the missiles were ballistic and are believed to have flown more than 250 miles &amp;#40;400 kilometers&amp;#41;.&lt;br /&gt;&lt;br /&gt;&amp;#34;Our military is fully ready to counter any North Korean threats and provocations based on strong South Korea-U.S. combined defense posture,&amp;#34; the Joint Chiefs of Staff said in a statement.&lt;br /&gt;&lt;br /&gt;South Korea&amp;#39;s Yonhap news agency quoted military officials as saying the missiles appeared to be a type of Scud missile. North Korea&amp;#39;s Scuds are considered short-range, the South&amp;#39;s military said.&lt;br /&gt;&lt;br /&gt;But Yonhap also said that it is possible they could have been longer-range Rodong missiles fired a shorter distance.&lt;br /&gt;&lt;br /&gt;Scud missiles have a range of up to 300 miles &amp;#40;500 kilometers&amp;#41;, which could hit most of South Korea. The Rodong has a range of up to 800 miles &amp;#40;1,300 kilometers&amp;#41;, putting most parts of Japan within striking distance.&lt;br /&gt;&lt;br /&gt;North Korea is not allowed to fire Scuds, medium-range missiles or long-range missiles. They are banned under U.N. resolutions, including Resolution 1874 passed after North Korea&amp;#39;s May 25 nuclear test, that prohibit any launch using ballistic missile technology.&lt;br /&gt;&lt;br /&gt;Thursday&amp;#39;s launches, on the other hand, did not violate the resolution, according to South Korea&amp;#39;s Foreign Ministry. Kim Tae-woo, vice president of the Korea Institute for Defense Analyses, said it was believed North Korea launched cruise missiles Thursday.&lt;br /&gt;&lt;br /&gt;Ballistic missiles are guided during their ascent out of the atmosphere but fall freely when they descend. Cruise missiles fly low and straight to their target.&lt;br /&gt;&lt;br /&gt;The North has a record of timing missile tests for the U.S. national day, which fell on Saturday.&lt;br /&gt;&lt;br /&gt;&amp;#34;The missiles were seen as part of military exercises, but North Korea also appeared to have sent a message to the U.S. through the missile launches,&amp;#34; a senior official in South Korea&amp;#39;s presidential office said, without elaborating.&lt;br /&gt;&lt;br /&gt;The official told The Associated Press that North Korea could fire more missiles in coming days, but said there was little possibility it could fire an intercontinental ballistic missile, as it threatened in April.&lt;br /&gt;&lt;br /&gt;He spoke on condition of anonymity because he was not authorized to speak to media. Daniel Pinkston, a Seoul-based analyst for the International Crisis Group think tank, said both political and military reasons were behind the launches.&lt;br /&gt;&lt;br /&gt;&amp;#34;I think it&amp;#39;s a demonstration of their defiance and rejection of the U.N. Security Council Resolution 1874, for one thing, and to demonstrate their military power capabilities to any potential adversaries,&amp;#34; Pinkston said.&lt;br /&gt;&lt;br /&gt;He also pointed out that July 4 is not only U.S. Independence Day but also the anniversary of a 1972 joint communique in which the two Koreas agreed to work toward peacefully reunifying their divided peninsula.&lt;br /&gt;&lt;br /&gt;During the U.S. Independence Day holiday in 2006, Pyongyang fired a barrage of missiles, including a long-range Taepodong-2 that broke apart and fell into the ocean less than a minute after liftoff. Those launches, which occurred on July 5 in North Korea, also came amid tensions with the U.S. over North Korea&amp;#39;s nuclear program.&lt;br /&gt;&lt;br /&gt;North Korea&amp;#39;s state news agency carried no reports on the launches. But the North had warned ships to stay away from its east coast through July 10 for military exercises - an indication it was planning launches.&lt;br /&gt;&lt;br /&gt;The chief of U.S. Naval operations, Adm. Gary Roughead, said Saturday the American military was ready for any North Korean missile tests.&lt;br /&gt;&lt;br /&gt;&amp;#34;Our ships and forces here are prepared for the tracking of the missiles and observing the activities that are going on,&amp;#34; Roughead said after meeting Japanese military officials in Tokyo before news of the launches.&lt;br /&gt;&lt;br /&gt;South Korea and Japan, which are within easy range of North Korean missiles, condemned the launches as a &amp;#34;provocative&amp;#34; act that violates the U.N. resolution.&lt;br /&gt;&lt;br /&gt;South Korea &amp;#34;expressed deep regret over the North&amp;#39;s continuous behavior that escalates tensions in Northeast Asia by repeatedly defying&amp;#34; the resolution, the Foreign Ministry said in a statement.&lt;br /&gt;&lt;br /&gt;In Tokyo, Chief Cabinet Secretary Takeo Kawamura said in a statement that the launch of missiles &amp;#34;is a serious act of provocation against the security of neighboring countries, including Japan, and is against the resolution of the U.N Security Council.&amp;#34;&lt;br /&gt;&lt;br /&gt;In Beijing, a Foreign Ministry spokesman said he had no immediate comment. China is the North&amp;#39;s closest ally.&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;!--SPOILER BEGIN--&gt;&lt;div class=&quot;spoilertop&quot; onClick=&quot;openClose('fae3b4d1c10f35e9452beb6af9114caf')&quot; style=&quot;font-weight: bold&quot;&gt;&lt;u&gt;&amp;raquo; Click to show Spoiler - click again to hide... &amp;laquo;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;spoilermain&quot; id=&quot;fae3b4d1c10f35e9452beb6af9114caf&quot; style=&quot;display:none&quot;&gt;&lt;!--SPOILER END--&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://thestar.com.my/news/story.asp?file=/2009/7/4/apworld/20090704152044&amp;sec=apworld' target='_blank'&gt;http://thestar.com.my/news/story.asp?file=...044&amp;sec=apworld&lt;/a&gt;&lt;!--SPOILER DIV--&gt;&lt;/div&gt;&lt;!--SPOILER DIV--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sun, 05 Jul 2009 01:09:45 +0800</pubDate>
        </item>
        <item>
            <title>edit this</title>
            <link>http://forum.lowyat.net/topic/1085101</link>
            <description>&lt;!--SPOILER BEGIN--&gt;&lt;div class=&quot;spoilertop&quot; onClick=&quot;openClose('3ecc1b4da136b5bf9ee0383cba9fbf71')&quot; style=&quot;font-weight: bold&quot;&gt;&lt;u&gt;&amp;raquo; Click to show Spoiler - click again to hide... &amp;laquo;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;spoilermain&quot; id=&quot;3ecc1b4da136b5bf9ee0383cba9fbf71&quot; style=&quot;display:none&quot;&gt;&lt;!--SPOILER END--&gt;&lt;a href='http://img217.imageshack.us/i/77601868.png/' target='_blank'&gt;&lt;img src='http://img217.imageshack.us/img217/8007/77601868.png' border='0' alt='user posted image' /&gt;&lt;/a&gt;&lt;br /&gt;&lt;!--SPOILER DIV--&gt;&lt;/div&gt;&lt;!--SPOILER DIV--&gt;&lt;br /&gt; &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Sat, 04 Jul 2009 23:33:33 +0800</pubDate>
        </item>
        <item>
            <title>what  is the wheather in japan</title>
            <link>http://forum.lowyat.net/topic/1083693</link>
            <description>anyone pls help</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Fri, 03 Jul 2009 16:32:43 +0800</pubDate>
        </item>
        <item>
            <title>Which uni do you prefer....?</title>
            <link>http://forum.lowyat.net/topic/1079346</link>
            <description>? &lt;!--emo&amp;:hmm:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/hmm.gif' border='0' style='vertical-align:middle' alt='hmm.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>greenwire85</author>
            <category>The Museum Of Kopitiam</category>
            <pubDate>Mon, 29 Jun 2009 17:16:06 +0800</pubDate>
        </item>
        <item>
            <title>Which one is better</title>
            <link>http://forum.lowyat.net/topic/958200</link>
            <description>SEED&lt;br /&gt;&lt;br /&gt;G2000 blu, &lt;br /&gt;&lt;br /&gt;Padini&lt;br /&gt;&lt;br /&gt;Which one?</description>
            <author>greenwire85</author>
            <category>Men&amp;#39;s Style &amp;amp; Fashion</category>
            <pubDate>Sun, 08 Mar 2009 19:31:54 +0800</pubDate>
        </item>
        <item>
            <title>made a bad move with a girl....</title>
            <link>http://forum.lowyat.net/topic/952612</link>
            <description>is cool to contact her?</description>
            <author>greenwire85</author>
            <category>Cupid&amp;#39;s Corner</category>
            <pubDate>Tue, 03 Mar 2009 02:04:53 +0800</pubDate>
        </item>
    </channel>
</rss>
