ts-7000
[Top] [All Lists]

[ts-7000] my what a big endian you have !

To:
Subject: [ts-7000] my what a big endian you have !
From: "j.chitte" <>
Date: Wed, 20 Feb 2008 18:41:58 -0000
Hi,

I would like some confirmation of what I think is happening with an 
exit value.

I have a cgi that is written in C and a control prog based on 
adc_logger also in C. These both then run on the ARM.


char get_portA ()
{
  return(*portA_dr);
}

....

  pump_state=get_portA();

.....

  fprintf(stderr,"pump_state on return=%d",pump_state);
  if (state_request) exit(get_portA()); 
...
} // end of main


I call this from my cgi responder:

        strcpy(cmd,"./adc_logger -s");
        if ( 0>(resp=system(cmd)) ) {  // -1 fork failed
...
        } else {
          printf(text_head);
          printf("pump_state=%d\n",resp);
          exit(0);


Now the error log shows pump_state=23 , which was correct but by the 
time it gets back the browser on x86 it's 5888 , as hex 1700 !

So there seems to be byte reversal.

Is this due to archectecture differences?! I dont think I need to 
know the hardware to get the correct answer so why is this happening?

BTW , I call the cgi via an xhttp object in javascript.

Thanks for any help.

/jacques.




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU