From: Damon Hogan Newsgroups: comp.os.msdos.djgpp Subject: 388: fixed or forbidden register 0 (ax) was spilled for class AREG. fly. Date: Wed, 15 Mar 2000 17:45:45 -0700 Organization: XMission http://www.xmission.com/ Lines: 151 Message-ID: <38D02EB9.89DC1F89@pgmincorporated.com> NNTP-Posting-Host: mail.pgmincorporated.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.xmission.com 953167803 1880 166.70.119.101 (16 Mar 2000 00:50:03 GMT) X-Complaints-To: abuse AT xmission DOT com NNTP-Posting-Date: 16 Mar 2000 00:50:03 GMT X-Mailer: Mozilla 4.6 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am compiling the fly.exe program for the plush3d library and I get the following error messages. I get the same error messages on other libraries,/programs that I try to compile with inline assembly code. I think that this is a problem with djgpp's gcc I'm not sure. fly.c: In function `main': fly. c:55: warning: return type of `main' is not `int' fly. c: In function `mouse_init': fly. c:388: Invalid `asm' statement: fly. c:388: fixed or forbidden register 0 (ax) was spilled for class AREG. fly. c: In function `mouse_get': fly.c:404: Invalid `asm' statement: fly. c:404: fixed or forbidden register 1 (dx) was spilled for class DREG. fly. c:412: Invalid `asm' statement: fly. c:412: fixed or forbidden register 3 (bx) was spilled for class BREG. fly. c: In function `set_palette': fly. c:371: Invalid `asm' statement: fly. c:371: fixed or forbidden register 4 (si) was spilled for class SIREG. fly. c: In function `set_mode13': fly. c:376: Invalid `asm' statement: fly. c:376: fixed or forbidden register 0 (ax) was spilled for class AREG. fly. c: In function `set_mode3': fly. c:380: Invalid `asm' statement: fly. c:380: fixed or forbidden register 0 (ax) was spilled for class AREG. fly. c: In function `fpucopy': fly.c:345: Invalid `asm' statement: fly. c:345: fixed or forbidden register 2 (cx) was spilled for class CREG. make.exe: *** [fly.o] Error 1 C:\djgpp\contrib\plush\examples\fly> The code section for this is below and the errors seem to be on lines that all have the same coding scheme for this and other programs written that have this same problem. Does any body know how to adjust this code or fix the compiler to work? Code examples listed below. Stars (*) by the error lines. 331:static void inline fpucopy(void *o, void *i, int len16) { 332: __asm__ __volatile__(" 333: .align 4, 0x90 334: 0: 335: fildq (%%esi) 336: fildq 8(%%esi) 337: fxch 338: fistpq (%%edi) 339: fistpq 8(%%edi) 340: addl $16, %%edi 341: addl $16, %%esi 342: decl %%ecx 343: jnz 0b 344: "::"c" (len16), "S" (i), "D" (o) *345: :"%ecx","%edi","%esi"); 346:} 347: 348:void inline vsync() { 349: __asm__ __volatile__ ("movw $0x3DA, %%dx 350: 0: inb %%dx, %%al ; andb $8, %%al ; jnz 0b 351: 0: inb %%dx, %%al ; andb $8, %%al ; jz 0b" 352: :::"%edx", "%eax"); 353:} 354: 355:void set_palette(char *pal) { 356: __asm__ __volatile__(" 357: movl $768, %%ecx 358: subl %%eax, %%eax 359: movw $0x3C8, %%dx 360: outb %%al, %%dx 361: incw %%dx 362: 0: 363: movb (%%esi), %%al 364: #addl $2, %%eax 365: shrl $2, %%eax 366: outb %%al, %%dx 367: incl %%esi 368: subl %%eax, %%eax 369: decl %%ecx 370: jnz 0b *371: "::"S" (pal):"%esi", "%eax", "%edx", "%ecx"); 372:} 373: 374:void set_mode13() { 375: __djgpp_nearptr_enable(); 376: __asm__ __volatile__("int $0x10"::"a" (0x13):"%eax", "%ebx", "%ecx", "%edx"); 377:} 378: 379:void set_mode3() { *380: __asm__ __volatile__("int $0x10"::"a" (3):"%eax", "%ebx", "%ecx", "%edx"); 381: __djgpp_nearptr_disable(); 382:} 383: 384:void mouse_init() { 385: __asm__ __volatile__(" 386: subl %%eax, %%eax 387: int $0x33 *388: ":"=a" (mouse_avail), "=b" (mouse_buttons)::"%eax","%ebx","%ecx","%edx"); 389: if (!mouse_avail) { 390: printf("Mouse not found ... you won't be able to move\n"); 391: } 392: if (mouse_buttons > 3) mouse_buttons = 3; 393: printf("%d button mouse found\n",mouse_buttons); 394: 395:} 396: 397:void mouse_get() { 398: static signed short int old_mouse_x, old_mouse_y; 399: signed short int mx, my; 400: if (mouse_avail) { 401: __asm__ __volatile__(" 402: movl $11, %%eax 403: int $0x33 *404: ":"=c" (mx), "=d" (my)::"%eax","%ebx","%ecx","%edx"); 405: mouse_x = (old_mouse_x + mx) * 0.5; 406: mouse_y = (old_mouse_y + my) * 0.5; 407: old_mouse_x = mx; 408: old_mouse_y = my; 409: __asm__ __volatile__(" 410: movl $3, %%eax 411: int $0x33 *412: ":"=b" (mouse_b)::"%eax","%ebx","%ecx","%edx"); 413: mouse_b &= 7; 414: } else mouse_x = mouse_y = mouse_b = 0; 415:} 416: -- Damon Hogan Sr Programmer/Analyst PGM, Inc. damonh AT pgmincorporated DOT com http://www.pgmincorporated.com http://www.pgmincorporated.com/site-imgs/dh.gif Voice (801) 434-4054 /Voice Mail Fax (801) 434-7304