From: ian_d AT elric DOT accuris DOT ie (Ian Dunbarr) Newsgroups: comp.os.msdos.djgpp Subject: NASM and DJGPP question Date: 16 Jan 1998 17:35:13 GMT Organization: Telecom Internet, Dublin, Ireland. Lines: 23 Message-ID: Reply-To: ian_dunbar AT hotmail DOT com NNTP-Posting-Host: 159.134.174.252 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.