Mail Archives: djgpp/1996/12/02/09:41:31
<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 -