does djgpp cache variables
Posted: Fri Sep 23, 2005 11:00 pm
I have been creating an OS and really have ran into some very trivial problems
from what i can tell it is as if djgpp is caching variables.
here is my problem; i have an interrupt handler; every timer tick it advances a variable and puts the number of ticks on the screen(for debugging), so i have a little wait function which goes like this
so does djgpp cache its variables or something as from what i can tell this should work
edit:
and now i get an opcode error from this simple code
from what i can tell it is as if djgpp is caching variables.
here is my problem; i have an interrupt handler; every timer tick it advances a variable and puts the number of ticks on the screen(for debugging), so i have a little wait function which goes like this
Code: Select all
void wait(int ticks){
ticks=ticks+timer_ticks; /*timer ticks is updated by interrupt, no matter what*/
while (ticks>timer_ticks) /*keep in mind that timer ticks advances every 55ms*/
{/*do nothing*/}
/*and return*/
}
edit:
and now i get an opcode error from this simple code
Code: Select all
void beep(void){
dword timey;dword t;
timey=timer_ticks+100;
while(timey>timer_ticks){}
/*printf("i"); if you uncomment this then no opcode error and it repeats this command over and over*/
}