=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-24-93 (13:31) Number: 81 From: EARL MONTGOMERY Refer#: NONE To: ALL Recvd: NO Subj: Interrupts Conf: (35) Quick Basi --------------------------------------------------------------------------- rem The following is an interactive program to help rem programmers understand how interrupts work within rem Quick Basic. It is intended for those new to rem interrupts but may help even the more experienced. rem Part 1 of 3 parts '$INCLUDE: 'qb.bi' DIM inregs AS regtypex, outregs AS regtypex CLS LOCATE 1, 1: PRINT "For those of you that have mastered the use "; PRINT "of interrupts, read no further!"; LOCATE 2, 1: PRINT "However if you are like me and still"; PRINT " struggling you might find this interesting."; LOCATE 3, 1: PRINT "First off whenever you use an interrupt with"; PRINT " QB you need to load QB/L."; LOCATE 4, 1: PRINT "This loads the QB.QLB library which contains"; PRINT " the code needed to use interrupts."; LOCATE 5, 1: PRINT "Now you are ready to program! Your first"; PRINT " entry should be '$INCLUDE: 'QB.BI'"; LOCATE 6, 1: PRINT "This file contains the TYPE and Data"; PRINT " structure to be used."; LOCATE 7, 1: PRINT "List QB.BI from DOS and you will see there "; PRINT "are two types defined."; LOCATE 8, 1: PRINT "RegType and RegTypeX. Notice that both are "; PRINT "identical except that"; LOCATE 9, 1: PRINT "RegTypeX allows the use of the ES and DS "; PRINT "segment registers."; LOCATE 10, 1: PRINT "Your next entry should be: DIM inregs as "; PRINT "regtypex,outregs as regtypex"; LOCATE 11, 1: PRINT "Now we need to call an interrupt. If you "; PRINT "have the DOS programmers manual"; LOCATE 12, 1: PRINT "look at interrupt &h21 function &h19. This "; PRINT "interrupt gets the Default"; LOCATE 13, 1: PRINT "Drive and returns the info in AL of register"; PRINT " AX. If AL returns a 0 this"; LOCATE 14, 1: PRINT "represents Drive A. If AL returns a 1 then "; PRINT "this represents drive B. If AL"; LOCATE 15, 1: PRINT "returns a 2 this represents Drive C and so on." LOCATE 16, 1: PRINT "Now we need to put something in register AX"; PRINT " and that is the function &H19."; LOCATE 17, 1: PRINT "INREGS.AX=&H1900" LOCATE 18, 1: PRINT "Now we call the interrupt." LOCATE 19, 1: PRINT "CALL INTERRUPTX(&h21,INREGS,OUTREGS)" LOCATE 23, 28: PRINT "Press any key to continue." WAIT1: I$ = INKEY$: IF I$ = "" THEN GOTO WAIT1 CLS LOCATE 1, 1: PRINT "OK the DOS programmers manual said that the "; PRINT "info would be returned in AL."; LOCATE 2, 1: PRINT "How do we read AL from register AX? Use this"; PRINT " formula:"; LOCATE 3, 1: PRINT "AL=AX AND &HFF (More on these formulas later.)" LOCATE 4, 1: PRINT "PRINT AL" LOCATE 5, 1: PRINT : PRINT "Let's put everything together and "; PRINT "see what we have."; LOCATE 7, 1: PRINT "'$include: 'Qb.BI'" LOCATE 8, 1: PRINT "DIM inregs AS RegTypeX,outregs AS RegTypeX" rem end of part one --- Maximus 2.01wb * Origin: Rabbit and Snake's BBS - Richardson, Texas (1:124/6108) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20