Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

AMIS, Optimize memory usage (Developers)

posted by Japheth Homepage, Germany (South), 13.05.2011, 07:28

> That precaution probably seemed necessary to the seasoned (and
> cautious) professional programmer but, oyez! oyez! hear...!, both
> the clueless newbie (confused anyway with all that there interrupt stuff),
> AND... the "good (TM)" programmer (after carefully checking his facts) will
> omit the flag save/restore (thereby reducing the size of the
> resident KBFR by a whopping 6 bytes iirc) :=)

Cool!

> The reason a software int 15h "hook" does not need to preserve the running
> flags is, of course, that no information is passed "down" thru them and,
> conversely, in cases information has to be passed back "up" to the
> (initial) caller, it is by altering the flags image put on the stack by the
> initial int 15 caller, not the running flags.

This is true ............ to some degree. :))

However ... there are a few considerations:

- int 15h is an interrupt which is used for a lot of purposes.
- there exists software, including BIOSes, which do NOT return
from this interrupt by an IRET, but by a RETF 2.
- a lot of software sets (or resets) the carry flag BEFORE it calls Int 15h.
( this is probably done because there exist buggy hookers/BIOSes ).

So, considering these facts(?), one might come to realize that it is at least "thinkable" that saving the flags status is not absolutely useless. I guess - it was in 1993! - that was the reason why I added it.

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 232 users online (0 registered, 232 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum