문제

I’m in a strange situation I have coded myself into, trapped! I am taking an OS course where we are writing a non-preemptive scheduler, i am in a situation where I need to make some easy calculation about time measurement in a context switch.

For my average calculation I am in need for division with decimals, my code now calls a C function from assembler for the calculation and prints the result to screen, this C function uses double, later i realized that double division will cause changes to the x87 registers because the get_time(C function) function is called right before the context switching and right after. Is there a way to do decimal division avoiding changes to x87 registers? I sorely need some tips and help.

올바른 솔루션이 없습니다

다른 팁

I don't have much skills in asm and registers uses, but maybe :

  • what if you push your register and pop it at the end ?
  • You said that double division change to the x87 registers, what about float ?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top