Tiny Intro Toolbox Thread

category: code [glöplog]
I was imagining things. :) The one-write version is not any faster.

Is there something that can be assumed in general about which registers are preserved by DOS calls?
added on the 2019-04-17 12:34:04 by Blueberry Blueberry
@Blueberry: you could look here and here, not sure it really preserves the things which are *not* mentioned in the "return values" list
added on the 2019-04-17 12:45:05 by HellMood HellMood
On a real dos you can just trace into the interrupts and look if the service routines preserve explicitly (pusha, pushf, push *s), never tried that on a dosbox though ^^
added on the 2019-04-17 12:46:34 by HellMood HellMood
I was curious because evidently the WRITE call (int 21h, AH=40h) preserves BX. But this doesn't seem to be mentioned in any of those docs.
added on the 2019-04-17 13:04:25 by Blueberry Blueberry
@Blueberry: i debugged into int21h for AH = 3Ch (virtual box, msdos 6.22, debug.exe, "t" & "p") and from what i saw, it pushed/popped everything it changes inside, besides the return values. Of course i can't cover every case but there is also this : "If calls are made by the approved method the contents of all registers are preserved through calls". That's also what one would assume intuitively, right?
added on the 2019-04-17 19:34:13 by HellMood HellMood
Also, german source : "Generell gilt, dass die Registerinhalte vor dem Aufruf von INT21h-Funktionen nicht gesichert werden müssen, denn sie bleiben erhalten. Das gilt natürlich nicht für die Register, in denen die betreffende INT21h-Funktion Werte zurückgibt."
added on the 2019-04-17 19:38:26 by HellMood HellMood