TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SYLVAIN LAUZON
from: DENIS BOYLES
date: 1997-04-08 11:54:00
subject: INDOS Flag

Hi Sylvain,
SL>I've tried many possibilities about the infinate loop i got
SL>when print to the console. Here is two examples.
How are you using these examples? By that, I mean, how is your program setup
when you use them?
SL>case 1:
SL>checking the indos flag (if set don't print anything and jump here)
SL>now its safe print via int 21/09
SL>here:
SL>Results: an infinate loop!
Hmm, that would seem the right thing to do. Check the INDOS flag, if it's 1
then DOS is active, so don't call any DOS functions. Where is this code
situated? If it's in the DOS interrupt itself, than this would probably be
expected.
Somewhere down the chain when the DOS interrupt is called, the INDOS flag is
being set. Then when it comes to your code, the flag is set, so you skip
the print and exit as normal. Either way, the INDOS flag will always be
set since you're in the interrupt. There isn't a chance for the flag to be
seto to zero.
SL>case 2:
SL>checking the indos flag (if zero don't print anything and jump here)
SL>now its safe print via int 21/09
SL>here:
SL>Results: good!
Well this would the opposite of what I've said above. If your hooked into
the DOS interrupt, then the flag will always be set. However in such a
case, you wouldn't even need to check anyway. You could just "skip" that
code and go to the print itself. Though either way I don't think it's good
to call DOS within DOS itself. Unless you're on a different interrupt or
something.
SL>I really don't understand case 2, because some docs says to
SL>not use DOS functions below 0Ch when indos flag is set. If
SL>i follow this exactly i got the infinate loop. So what's wrong?
I would probably have to examine the code itself to get a better idea.
Though I recall something that said it's ok to use a certain range of DOS
functions.
SL>Also in case 2, the print function looks funny. Say that it prints
SL>something like this:
SL>My test!
SL>My test!
SL>My test!
SL>C:\WINDOWS>My test!
SL>My test!
Hmm, possibly a register is being changed which might need to be saved on
the stack?
SL>If you have an idea let me know!
Well, aside from what I've mentioned above, I put together my own little
test programs. I'll post them to you as seperate messages, perhaps they
might prove helpful.
The first one, I simply call, INDOS, and is a TSR that changes the border
color according to the INDOS flag. The border will be "black" if the flag
is 0 and "blue" if the flag is 1. Hooking into the timer ticker, it
provides a "visual" clue to the INDOS state. Might come in handy for
debugging or just for curiousity and wonderment.
The second program is BOSSKEY, my attempt at a TSR that utilizes the
INDOS flag. Just like in some games, :), it will turn the screen into a
"Command Line" looking prompt. Pressing ALT-SYSRQ activates it and then any
other key afterwards restores the screen.
I used DOS function AH=09 to print the "prompt" so I tested for the INDOS
flag. Thus the program will only really activate when the INDOS flag is set
to 0. Even though you may have pressed the "hot-key" it still requires
INDOS=0 to actually activate.
Comments on both programs?
Cheers,
  Denis Boyles
 * OLX 2.1 TD * Hello, I am part number ||X||||X||X||X||
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.