Mail Archives: djgpp/1997/07/12/01:38:18
You wrote:
>I'm trying one of the VGA mem mapping procedures that is in
>the FAQ(right out of 18.4). When I try to get the descriptor
>w/ "short vid_mem=__dpmi_segment_to_descriptor(0xA000);"
>I get this error - "Intializer is not constant" (paraphrased).
My guess is you placed the line outside of any function. In C, global or
static variables can only be initialized to something which can be figured
out at compile time, and that doesn't include function calls. Probably you
should do something like this:
short vid_mem;
/* stuff */
int main(void)
{
/* ... */
vid_mem = __dpmi_segment_to_descriptor(0xA000);
/* ... */
}
If the program is more complicated, you could move it to an `init' function.
Nate Eldredge
eldredge AT ap DOT net
flag) of the EFLAGS CPU
>> register afterwards, e.g. by a JPE (conditional jump short on parity even
>> PF=1).
>
>You'ld be better off using 'setpe' rather than 'jpe', as it't much less
>expensive:
>
>asm volatile("or %1,%1;setpe %b0":"=g"(result):"r"(value):"cc");
>
Nate Eldredge
eldredge AT ap DOT net
- Raw text -