=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-24-93 (13:34) Number: 82 From: EARL MONTGOMERY Refer#: 232 To: ALL Recvd: NO Subj: Interrupts Conf: (35) Quick Basi --------------------------------------------------------------------------- REM Part 2 of 3 parts LOCATE 9, 1: PRINT "inregs.ax=&h1900" LOCATE 10, 1: PRINT "CALL INTERRUPTX(&h21,INREGS,OUTREGS)" LOCATE 11, 1: PRINT "AX = (outregs.ax)" LOCATE 12, 1: PRINT "AL=AX AND &Hff" LOCATE 13, 1: PRINT "PRINT AL" LOCATE 14, 1: PRINT "Now let's actually run this program. Ready?"; PRINT " Here goes!"; inregs.AX = &H1900 CALL interruptx(&H21, inregs, outregs) loop1: LOCATE 15, 28: PRINT "Press any key to continue." I$ = INKEY$: IF I$ = "" THEN GOTO loop1 REM Formula to find AL. AX = (outregs.AX) AL = AX AND &HFF REM Looking for a 2 in AL (My default drive is C) PRINT AL LOCATE 19, 1: PRINT "Well I got a 2 because my default drive is "; PRINT "C. How about you?"; LOCATE 23, 28: PRINT "Press any key to continue." wait2: I$ = INKEY$: IF I$ = "" THEN GOTO wait2 CLS LOCATE 1, 28: PRINT "Formulas to read AH and AX." LOCATE 2, 1: PRINT "Now let's see how we can read AH." LOCATE 3, 1: PRINT "To find AH the formula is "; PRINT "AH=(AX AND &HFF00)/256"; LOCATE 4, 1: PRINT "Let's run it and see what we get." LOCATE 5, 28: PRINT "Press any key to continue." loop3: I$ = INKEY$: IF I$ = "" THEN GOTO loop3 AH = (AX AND &HFF00) / 256 PRINT AH LOCATE 7, 1: PRINT "I got 25. How about you?" PRINT LOCATE 10, 1: PRINT "Well we know the value of AL and AH. With "; PRINT "these two values"; LOCATE 11, 1: PRINT "we can find out what is in AX. The formula "; PRINT "is AX=(256*ah)+AL"; LOCATE 12, 1: PRINT "In my case AL was 2 and AH was 25. So 256 *"; PRINT " 25 + 2 in AL=6402"; LOCATE 13, 1: PRINT "Let's run it and see what we get." AX = (256 * AH) + AL LOCATE 14, 28: PRINT "Press any key to continue." loop4: I$ = INKEY$: IF I$ = "" THEN GOTO loop4 PRINT AX LOCATE 17, 1: PRINT "My values matched how about yours?" LOCATE 23, 28: PRINT "Press any key to continue." loop5: I$ = INKEY$: IF I$ = "" THEN GOTO loop5 CLS LOCATE 1, 1: PRINT "But someone is saying in "; PRINT "AX how can it contain 6402!"; LOCATE 2, 1: PRINT "Did I mention the AX,BX,CX and DX registers "; PRINT "are 16 bit registers?"; rem End of part 2 of 3 parts --- 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