BBS: Inland Empire Archive
Date: 06-15-92 (08:35) Number: 493
From: SCOTT WUNSCH Refer#: NONE
To: PHIL HODGES Recvd: NO
Subj: Interrupts Conf: (2) Quik_Bas
PH> In order to further myself as a programmer (and to prove to
PH> myself that you don't have to know C to use complicated DOS
. . .
PH> example for CALL INTERRUPT helped a little (but WHY did they use
PH> INT86OLD ???). Still, I'm not totally clear on this.
DIM Regs AS RegType
Regs.ax = &H3000
CALL INTERRUPT(&H21, Regs, Regs)
MajorVersion = Regs.ax MOD 256
MinorVersion = Regs.ax \ 256
PRINT USING "Current DOS version #!##"; MajorVersion; "."; MinorVersion
PH> The book says that 21H function 30H gets the DOS version number.
PH> From the above example I can conclude that the H is 00, therefore
PH> &H3000 is function 30H. Seems easy enough to understand.
Sorry, not so easy. The H simply identifies the number as
PH> What I _don't_ understand is how the above code works. The book
PH> lists the returns as:
PH> AL = major version number
PH> AH = minor version number
PH> BH = original equipment manufacturers serial number
PH> BL:CX =24-bit user serial number (optional, OEM dependent)
^^^ ?! Never heard of that!
The AL and AH are actually low and high bytes of AX. You see,
integers (all registers are this) are composed of two bytes. The
CL. OK, when using hexidecimal numbers, it's easy to see high and
low bytes. For example, in &H3000, the 30 is the high byte (AH), 00
is the low (AL). That's where the &H3000 came from.
Now, to extract the high and low bytes, you must use something
it for you).
PH> So... any help?
You saw it! ;)
-= Scott \\'unsch =-
... It's so BASIC it's gotta work!
--- Maximus/2 2.01wb
* Origin: The Green Zone - Regina, Sask, Canada (1:140/23)