delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/24/18:54:30

Sender: root AT delorie DOT com
Message-ID: <37EBAEA9.4362A1BC@inti.gov.ar>
Date: Fri, 24 Sep 1999 14:02:33 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.38 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: Laurynas Biveinis <lauras AT softhome DOT net>, djgpp AT delorie DOT com,
setedit AT topica DOT com
Subject: Re: TV 1.0.8 that compiles ;-)
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------22D06C7001CE4EC4111C9C06
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Laurynas Biveinis <lauras AT softhome DOT net> detected problems with gcc 2.95 to
compile the vgastate.c module of TV 1.0.8 (under DOS).
I fixed some problems in this module thanks to other report and now the code
compiles OK.
Attached are diffs to fix the problems.

SET

--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
                    set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



--------------22D06C7001CE4EC4111C9C06
Content-Type: text/plain; charset=us-ascii;
 name="to3-2.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="to3-2.txt"

--- vgaregs.h	1999/08/16 14:52:10	1.1
+++ vgaregs.h	1999/09/24 01:58:42
@@ -128,13 +128,14 @@
 extern inline
 uchar ReadCRT(uchar index)
 {
+ int dummy;
  uchar a asm("%eax");
  a=index;
  asm volatile ("
      outb %%al,%%dx
      incl %%edx
      inb  %%dx,%%al
-     " : "a=" (a) : "a" (a), "d" (CRTController) : "%edx");
+     " : "=a" (a), "=d" (dummy) : "a" (a), "d" (CRTController));
  return a;
 }
 
@@ -142,61 +143,66 @@
 extern inline
 uchar ReadGRA(uchar index)
 {
+ int dummy;
  uchar a asm("%eax");
  a=index;
  asm volatile ("
      outb %%al,%%dx
      incl %%edx
      inb  %%dx,%%al
-     " : "a=" (a) : "a" (a), "d" (GraphicsController) : "%edx");
+     " : "=a" (a), "=d" (dummy) : "a" (a), "d" (GraphicsController));
  return a;
 }
 
 extern inline
 uchar ReadSEQ(uchar index)
 {
+ int dummy;
  uchar a asm("%eax");
  a=index;
  asm volatile ("
      outb %%al,%%dx
      incl %%edx
      inb  %%dx,%%al
-     " : "a=" (a) : "a" (a), "d" (Sequencer) : "%edx");
+     " : "=a" (a), "=d" (dummy)  : "a" (a), "d" (Sequencer));
  return a;
 }
 
 extern inline
 void WriteCRT(uchar index, uchar value)
 {
+ int dummy;
  asm volatile ("
-     movb %0,%%ah
+     movb %1,%%ah
      outw %%ax,%%dx
-     " : : "qi" (value), "a" (index), "d" (CRTController) : "%eax");
+     " : "=a" (dummy) : "qi" (value), "a" (index), "d" (CRTController));
 }
 
 extern inline
 void WriteGRA(uchar index, uchar value)
 {
+ int dummy;
  asm volatile ("
-     movb %0,%%ah
+     movb %1,%%ah
      outw %%ax,%%dx
-     " : : "qi" (value), "a" (index), "d" (GraphicsController) : "%eax");
+     " : "=a" (dummy) : "qi" (value), "a" (index), "d" (GraphicsController));
 }
 
 extern inline
 void WriteSEQ(uchar index, uchar value)
 {
+ int dummy;
  asm volatile ("
-     movb %0,%%ah
+     movb %1,%%ah
      outw %%ax,%%dx
-     " : : "qi" (value), "a" (index), "d" (Sequencer) : "%eax");
+     " : "=a" (dummy) : "qi" (value), "a" (index), "d" (Sequencer));
 }
 
 
 extern inline
 void WaitVRT()
 {
- asm("
+ asm volatile("
  1:
      inb   %%dx,%%al
      testb $8,%%al
@@ -266,28 +272,32 @@
 extern inline
 void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant)
 {
-__asm__("
+ int dummy1,dummy2,dummy3,dummy4;
+__asm__ __volatile__("
      outb %%al,%%dx
      incl %%edx
      cli
      rep
      outsb
      sti"
-: : "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
-: "%eax", "%ecx", "%edx", "%esi");
+: "=a" (dummy1), "=d" (dummy2), "=S" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
+);
 }
 
 extern inline
 void RPF_GetPalRange(unsigned char *_pal_ptr, int color, int cant)
 {
-__asm__("
+ int dummy1,dummy2,dummy3,dummy4;
+__asm__ __volatile__("
      outb %%al,%%dx
      addl $2,%%edx
      cli
      rep
      insb
      sti"
-: : "c" (cant*3), "D" (_pal_ptr), "a" (color), "d" (0x3C7)
-: "%eax", "%ecx", "%edx", "%edi");
+: "=a" (dummy1), "=d" (dummy2), "=D" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "D" (_pal_ptr), "a" (color), "d" (0x3C7)
+);
 }
 

--------------22D06C7001CE4EC4111C9C06--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019