Sunday, May 14, 2006

Some Superfast Inline functions

The following functions are snippets to calculate trigonometry functions Sine and Cosine using GCC 3.1 or newer. fSinCos calculates sine and cosine simultaneously using FP assembly fsincos.


double fSin(double angle)
{
double _res;
asm ("fld %[angle]\nfsin"
: [output] "=&t" (_res)
: [angle] "0" (angle));
return _res;
}

void fSinCos(double angle, double *rsin, double *rcos)
{
double _arg = angle;
double _rsin, _rcos;
/*
asm ("fsinx %[angle],%[output]"
: [output] "=&t" (result)
: [angle] "f" (angle));
*/
// asm volatile("fld %[angle]" : "=t" (_rsin): [angle] "0" (angle));
asm volatile ("fsincos" : "=%&t" (_rcos), "=%&u" (_rsin) : "0" (angle));
*rsin = _rsin;
*rcos = _rcos;
}

But somehow, the fSinCos function stalls for some numbers. Dunno what it happened. Will post it later once I find the solution.

Friday, May 12, 2006

Heaven for hobbiest

Recently, my order of some chips had arrived. One package was from Analog-Device Ltd., another one was from Maxim Electronics Ltd. These microchips (various chips, but majority are ADC/DAC) were sent by them for free (yes, it is totally free, including the shipping and handling) as samples.

I was so delighted and cannot wait more to try some projects using these chips. Oh, by the way, I also ordered some components from Digikey.com (this one is not free, of course, but yet they sell components with affordable prices). My first project is to build a parallel-port Oscilloscope.

Monday, April 17, 2006

Thursday, March 16, 2006

Information Flood!

Nowadays, everything (well, almost) is interconnected. From my smartphone, my PC (both at work and home), Alarm clock, media player, my bills, my banks, mortgages, my credit cards are connected to the Internet or sort of network.

For example, my alarm clock is able to sync its time to Time Server that is broadcasting time information from its location in Borders, Colorado. My Cingular 8125 smartphone is able to communicate to the Internet via bluetooth, Wi-Fi, EDGE/GPRS, or USB cable via my laptop PC. Most of my bills, whether it is for electricity and gas, landline phone and DSL, or water & sewage are accessible and payable through the Internet. My mortgages are also at least viewable through browser. My credit cards are all accessible and payable through webpage. My bank accounts as well, even they can transfer money to my other accounts or for paying bills.

Furthermore, I also activate alerts from Yahoo! (email alerts, etc.), CNN (hot news) and TWC for weather. Every morning and afternoon, I get text messages on my cellphone about those things I have set. I also subscribe to some e-magazines (they are all free of charge, though).

I can check my car history thru the Internet. I can check my credit history on the Net as well. When I need a direction, I either go the mapquest.com or map.google.com to get street direction. I even install Microsoft Street software on my smartphone. If I need information about a traffic condition, I just go to www.511.org or call 511 from my cellphone.

At work, almost everything is done via Intranet. From seeing my paycheck, requesting leave/time-off or sellng my stock options/shares from my company. All of them accessible via the Net.

Not being enough with this, on my personal email accounts, I also subscribe to many mailing list which flood my accounts everyday. Not to count my work email that I also subscribe to some discussion lists.

Off the hook of the Net, I subscribe to some paper magazines. Then also borrow books from local library, paper printouts from work etc. bla..bla.....aaaaah!

Help, I am overwhelmed with such super information everyday!

Monday, March 13, 2006

Just testing from my Cingular 8125.

--

Mobile Email from a Cingular Wireless Customer http://www.cingular.com