Mail Archives: djgpp/1998/01/17/09:45:47
I've a question about programming routines in NASM, and then calling them from
DJGPP.
I've got a program which uses an asm routine called from DJGPP. It's actually
just a NASM-ified version of the Mode-X DrawHorizontalLineList asm function
from "The Zen of Graphics Programming", using protected mode selectors instead
of the original segment addressing.
This seems to work fine.
The function in question does not save all of the registers that it writes
to within the function. At the start it saves the stack frame, and one
addressing register (ESI I think). In the function it writes to a lot of the
other registers. probably mostly data registers (I don't have the code with me
to check).
So my question is whether is's just luck that the code works fine with djgpp
without saving registers it writes to, or does DJGPP assume that certain
registers are going to be trashed by any function. Does anyone know the rules
for all the registers when calling NASM code from DJGPP C code?
Thanks,
Ian.
- Raw text -