Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with calling Interrupts in MS BASIC PDS 7.1

40 views
Skip to first unread message

Leo

unread,
Mar 29, 2013, 7:10:28 AM3/29/13
to
I am trying to call Int 2F/AX=1600h in PDS running under DOSBOX. My
code is:

REM $INCLUDE: 'qbx.bi'

DIM inregs AS RegTypeX
DIM outregs AS RegTypeX

inregs.ax = &H1000

CALL interruptx(&H2F, inregs, outregs)

SELECT CASE outregs.ax
CASE 0
PRINT "Real Mode"

CASE &H10, &HFF
PRINT "Windows/386 2.x running"
CASE IS > 3
PRINT "Windows 3.x is running"
PRINT outregs.ax
END SELECT

I am getting 4096 back. Can someone assist me with this please.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


R.Wieser

unread,
Mar 29, 2013, 10:00:30 AM3/29/13
to
Leo,

> I am trying to call Int 2F/AX=1600h

You're not, according to the below:

> inregs.ax = &H1000

Shouldn't that be &H1600 :-)

Regards,
Rudy Wieser

P.s.
I allmost missed it, as I somehow made the same number-conversion mistake
you did. :-\ :-D


-- Origional message:
Leo <ttd...@gmail.com> schreef in berichtnieuws
kj3shs$l5d$1...@dont-email.me...

Leo

unread,
Mar 29, 2013, 12:10:50 PM3/29/13
to
Thanks for that. I am now getting 5632 out of it. Is that correct for
DOSBox that hasn't had windows launched? My reported DOS Version is
5.00.

Leo

unread,
Mar 29, 2013, 12:14:09 PM3/29/13
to
I should also add, when I run Windows and run the code from command.com
under Windows 3.11, I get back 2819.

Karl E. Peterson

unread,
Mar 29, 2013, 1:23:37 PM3/29/13
to
Leo laid this down on his screen :
> Thanks for that. I am now getting 5632 out of it. Is that correct for DOSBox
> that hasn't had windows launched? My reported DOS Version is 5.00.

Okay, first the caveat - it's been nearly 30 years since I used that
function! <LOL>

Looks to me like you're "getting back" exactly what you put in?

&H1600 = 5632

--
.NET: It's About Trust!
http://vfred.mvps.org


R.Wieser

unread,
Mar 29, 2013, 10:32:02 PM3/29/13
to
Leo,

> Thanks for that. I am now getting 5632 out of it. Is that
> correct for DOSBox that hasn't had windows launched?
> My reported DOS Version is 5.00.

As Karl mentioned, 5632 => &H1600. Ralf Brown's (Excellent) interupt list
says that if AL equals &H00 neither Windows 3.x enhanced mode nor
Windows/386 2.x is running.

> I should also add, when I run Windows and run the code
> from command.com under Windows 3.11, I get back 2819.

2819 => &H0B03. According to the docs, when AL is *not* &h00, &H01 or &H80
than AL is major version, AH is minor version. That means &H03,&H0B or 3.11
decimal. And that last result seems to be equal to the version of Windows
you're running. In short, it looks to be O.K.

Regards,
Rudy Wieser


-- Origional message:
Leo <ttd...@gmail.com> schreef in berichtnieuws
kj4eb8$kkh$1...@dont-email.me...

Leo

unread,
Mar 30, 2013, 9:28:04 AM3/30/13
to
R.Wieser was thinking very hard :
Thanks for the help and interpretation/explanation of the DOCs. I will
have a go at fixing my code and reply with my results to allow for
people to use this thread in the future as a reference.

R.Wieser

unread,
Mar 30, 2013, 11:06:35 AM3/30/13
to
Hello Leo,

> Thanks for the help and interpretation/explanation of the DOCs.

You're welcome.

By the way, those docs (Ralf Browns interrupt list (or RBIL) for short)
describes all interrupts and how they are used, often even by certain
programs. Its quite a "must have" when you are busy low-level programming.

Regards,
Rudy Wieser


-- Origional message:
Leo <ttd...@gmail.com> schreef in berichtnieuws
kj6ovp$v59$1...@dont-email.me...

Leo

unread,
Apr 2, 2013, 7:05:46 AM4/2/13
to
Karl E. Peterson submitted this idea :
I presume based on the other sub thread, that is because of it being a
Windows interupt for detecting Windows or XMS V1 so therefore nothing
is actualy there when they arent running.

Leo

unread,
Apr 2, 2013, 7:07:15 AM4/2/13
to
R.Wieser laid this down on his screen :
I should add I was using an HTML version of the RBIL, but wasn't
completely understanding it.

Here is the code I talked about:
REM $INCLUDE: 'qbx.bi'

DECLARE SUB GetWindowsVersion (Major AS INTEGER, Minor AS INTEGER)

SUB GetWindowsVersion (Major AS INTEGER, Minor AS INTEGER)
DIM inregs AS RegTypeX
DIM outregs AS RegTypeX

inregs.ax = &H1600

CALL interruptx(&H2F, inregs, outregs)

SELECT CASE outregs.ax AND 255
CASE &H0
Major = 0
Minor = 0
CASE IS >= &H3
Major = outregs.ax AND 255
Minor = outregs.ax / 256
CASE &HFF
Major = 2
Minor = 0

END SELECT

END SUB

R.Wieser

unread,
Apr 2, 2013, 10:14:25 AM4/2/13
to
Leo,

> SELECT CASE outregs.ax AND 255
> CASE &H0
> Major = 0
> Minor = 0
> CASE IS >= &H3
> Major = outregs.ax AND 255
> Minor = outregs.ax / 256
> CASE &HFF
> Major = 2
> Minor = 0
> END SELECT

That won't quite work. The "CASE IS >= &H3" includes the "CASE &HFF"
condition, so it will never be executed. :-\

Suggestion : Filter the "special" cases out (&H00, &H01 and &H80) and do the
major and minor split of the rest in a "CASE ELSE".

> I should add I was using an HTML version of the RBIL,

Good ! :-)

> but wasn't completely understanding it.

You now do? If not, don't hesitate to ask for clarification.

Regards,
Rudy Wieser


-- Origional message:

Leo <ttd...@gmail.com> schreef in berichtnieuws
kjedri$tv6$1...@dont-email.me...

Leo

unread,
Apr 2, 2013, 11:37:34 AM4/2/13
to
R.Wieser brought next idea :
> Leo,
>
>> SELECT CASE outregs.ax AND 255
>> CASE &H0
>> Major = 0
>> Minor = 0
>> CASE IS >= &H3
>> Major = outregs.ax AND 255
>> Minor = outregs.ax / 256
>> CASE &HFF
>> Major = 2
>> Minor = 0
>> END SELECT
>
> That won't quite work. The "CASE IS >= &H3" includes the "CASE &HFF"
> condition, so it will never be executed. :-\
>
> Suggestion : Filter the "special" cases out (&H00, &H01 and &H80) and do the
> major and minor split of the rest in a "CASE ELSE".
>
The below code was written in my newsreader so may not be exact and
plus I can't test for Windows/386 2.x since I don't have it.
So something like:
SELECT CASE outregs.ax AND 255
CASE &H80
'Don't do anything as I am not interested in XMS
CASE &H0
Major = 0
Minor = 0
CASE &HFF, &H1
Major = 2
Minor = 0
CASE ELSE
Major = outregs.ax AND 255
Minor = outregs.ax / 256
END SELECT

>
> Good ! :-)
>
>> but wasn't completely understanding it.
>
> You now do? If not, don't hesitate to ask for clarification.
I understand it alot better now.

Karl E. Peterson

unread,
Apr 2, 2013, 12:39:13 PM4/2/13
to
Leo brought next idea :
> Karl E. Peterson submitted this idea :
>> Looks to me like you're "getting back" exactly what you put in?
>>
>> &H1600 = 5632
>
> I presume based on the other sub thread, that is because of it being a
> Windows interupt for detecting Windows or XMS V1 so therefore nothing is
> actualy there when they arent running.

Have you read the docs? As I recall, these return values were rather
explicitly defined.

R.Wieser

unread,
Apr 2, 2013, 5:41:23 PM4/2/13
to
Leo,

> 'Don't do anything as I am not interested in XMS

That might be, but if you do it like that the 'Major' and 'Minor' variables
will simply not be altered from what the select case.

And that means you could get *any* result, including valid ones. :-o

Most likely though those two variables will simply stay Zero, falsely
indicating a 'CASE &H0' result. :-\

In other words: You *must* set a result there. Either set 'Major' and
'Minor' to some value indicating an error of sorts (both to 255 ?) or clear
an error-flag befor the 'select case' and set it in there (and ofcourse test
for it afterwards :-) ).

Regards,
Rudy Wieser


-- Origional message
Leo <ttd...@gmail.com> schreef in berichtnieuws
kjetmc$g9v$1...@dont-email.me...
<snip>

Leo

unread,
Apr 2, 2013, 6:34:32 PM4/2/13
to
After serious thinking Karl E. Peterson wrote :
> Leo brought next idea :
>> Karl E. Peterson submitted this idea :
>>> Looks to me like you're "getting back" exactly what you put in?
>>>
>>> &H1600 = 5632
>>
>> I presume based on the other sub thread, that is because of it being a
>> Windows interupt for detecting Windows or XMS V1 so therefore nothing is
>> actualy there when they arent running.
>
> Have you read the docs? As I recall, these return values were rather
> explicitly defined.

The docs just specify that AH can be &H00 and if that's the case, they
don't specify what AL would be as AH=&H00 means nothing installed.
AH=&H00 is what you get when you mask off AL with outregs.ax AND 255
when ax = &H1600. I suspect based on the other sub thread and the docs
that that was intended. http://www.ctyme.com/intr/rb-4495.htm I hope
that explains better what I was trying to say.

Leo

unread,
Apr 2, 2013, 6:39:15 PM4/2/13
to
R.Wieser has brought this to us :
Thanks for all your help. I went with setting them to 255.

R.Wieser

unread,
Apr 3, 2013, 4:50:06 PM4/3/13
to
Hello Leo,

> Thanks for all your help.

You're welcome.

> I went with setting them to 255.

A good choice. :-)

Regards,
Rudy Wieser


-- Origional message:
Leo <ttd...@gmail.com> schreef in berichtnieuws
kjfmd0$k9e$1...@dont-email.me...
> R.Wieser has brought this to us :
> > Leo,
> >
> >> 'Don't do anything as I am not interested in XMS
> >
> > That might be, but if you do it like that the 'Major' and 'Minor'
variables
> > will simply not be altered from what the select case.
> >
> > And that means you could get *any* result, including valid ones. :-o
> >
> > Most likely though those two variables will simply stay Zero, falsely
> > indicating a 'CASE &H0' result. :-\
> >
> > In other words: You *must* set a result there. Either set 'Major' and
> > 'Minor' to some value indicating an error of sorts (both to 255 ?) or
clear
> > an error-flag befor the 'select case' and set it in there (and ofcourse
test
> > for it afterwards :-) ).
> >
> > Regards,
> > Rudy Wieser

[Snip before-previous message]
0 new messages