www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/27/16:17:08

Original-Received: by jvdsys.nextjk.stuyts.nl
(FSUUCP-1.3r2) id A1920UI Fri Aug 25, 1995 23:07:06 EDT
PP-warning: Illegal Received field on preceding line
From: jerry AT jvdsys DOT nextjk DOT stuyts DOT nl (Jerry van Dijk)
Date: Fri Aug 25, 1995 23:07:05 EDT
Subject: More optimizing trouble
To: djgpp AT sun DOT soe DOT clarkson DOT edu

I'm still trying to get *any* program using the sys/farptr functions
working with optimizations switched in.

The following program gives -most times but not always- the following
error message when a -O? option is used:

c:/djgpp/include/sys/farptr.h: In function `main':
c:/djgpp/include/sys/farptr.h:159: `asm' operand constraint incompatible with operand size

Please can someone help me to preserve any sanity I might have left ?
:-))

The program:

/* Graphics test program */

#include <dos.h>
#include <go32.h>
#include <dpmi.h>
#include <stdio.h>
#include <sys/farptr.h>

int main( void )
{
  short x, y;
  _go32_dpmi_registers regs;
  unsigned long address, offset;

  /* Schakel naar VGA */
  regs.x.ax = 0x0012;
  regs.x.flags = regs.x.ss = regs.x.sp = 0;
  _go32_dpmi_simulate_int( 0x10, &regs );

  /* Draw differently colored vertical bands on the screen */
  for (x = 0; x < 640; x++) {

    /* Set color */
    outportb( 0x03c4, 2);
    outportb( 0x03c5, (x / 40) & 0x0F );

    /* Set bitmask */
    outportb( 0x03ce, 8 );
    outportb( 0x03cf, 0x80 >> ( x & 7 ) );

    /* Draw vertical line */
    offset = 0xa0000 + (x >> 3);
    _farsetsel( _go32_conventional_mem_selector() );
    for (y = 0; y < 480; y++) {
      address = offset + y * 80;
      _farnspeekb( address );
      _farnspokeb( address, 0xff );
    }
  }

  /* Wait for <Enter> */
  getchar();

  /* Return to text mode */
  regs.x.ax = 0x0003;
  regs.x.flags = regs.x.ss = regs.x.sp = 0;
  _go32_dpmi_simulate_int( 0x10, &regs );

  /* Done */
  return 0;
}

- Raw text -


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