delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/02/09:41:31

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT DELORIE DOT COM
Date: Mon, 2 Dec 1996 14:29:37 GMT
Subject: Failures when writing to screen in v2
Message-ID: <48FCF22D58@fs2.mt.umist.ac.uk>

  <Please reply to me directly by email, as I had to unsubcribe from djgpp
because of severe email intray overload.>
  I have a big Gnu C++ program which runs OK under v1. But in v2, when it
writes to text screen, it errors thus, however big the runtime stack is:-

    Exiting due to signal SIGSEGV
    Page fault at eip=0001dd94, error=0004

  It writes to the text screen thus:-
    c_s_addr screen((int)ScreenPrimary&0xfffff);   /* e.g.*/ screen[i]=j;

  where class c_s_addr is:-

#define SEL _go32_info_block.selector_for_linear_memory
class c_short {
  public: uns int addr;
  inline operator short() { return _farpeekw(SEL,addr); };
  inline uns short operator=(short c) { _farpokew(SEL,addr,c); return c; };
  };
class c_s_addr {
  public: uns int addr;
  inline c_s_addr(uns int Addr=0) { addr=Addr; };
  inline c_short operator[](int i) { c_short x; x.addr=addr+2*i; return x; };
  };

  What is the correct method with v2?

- Raw text -


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