From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu From: YAMANASHI Takeshi Date: Thu, 1 Jul 2004 13:50:35 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] fp: stack underflow error Topicbox-Message-UUID: b23a4c1e-eacd-11e9-9e20-41e7f4b1d025 I encountered a "sys: fp: stack underflow" error in my program. When I change the uint arguments of a2b() to int, the modified program ran successfully. What's wrong with my program? Thanks in advance. ++ program and acid stack trace are attached below ++ % nashi@valinore cat suflow.c #include #include /*{ 8c suflow.c; 8l suflow.8; ./8.out }*/ ulong a2b(uint fr, uint fg, uint fb, uint tr, uint tg, uint tb, double dis) { uchar r, g, b; r = fr + (tr - fr)*dis; g = fg + (tg - fg)*dis; b = fb + (tb - fb)*dis; return (r<<24)+(g<<16)+(b<<8)+0xFF; } void main() { int i; ulong p; for(i=0; i<256; i++) p=a2b(0, 0, 0xFF, 00, 0xFF, 00, 2.0*i/256.0); exits(nil); } % nashi@valinore ./8.out 8.out 1167: suicide: sys: fp: stack underflow fppc=0x1118 status=0x80a1 pc=0x0000118f % nashi@valinore acid 1167 /proc/1167/text:386 plan 9 executable /sys/lib/acid/port /sys/lib/acid/386 acid: stk() At pc:0x0000118f:main+0x46 /usr/nashi/src/test/suflow.c:27 main() /usr/nashi/src/test/suflow.c:21 called from _main+0x31 /sys/src/libc/386/main9.s:16 --