A sequence for initializing the interrupt pointers, which assumes the input interrupt has type 82 and the output interrupt has type 83, is given in Fig. 6-12.

      Figure 6-12 Program sequence for initializing the interrupt pointers

    PUSH DS                  ;SAVE DS
    XOR  AX, AX
    MOV  DS, AX              ;CLEAR DS SO AN ABSOLUTE LOCATION
    MOV  AX, OFFSET INT_ROUT ;MAY BE ADDRESSED
    MOV  BX, 148H
    MOV  [BX], AX            ;MOVE OFFSET OF INT_ROUT TO 148H
    MOV  AX, OFFSET OVERFLOW
    MOV  [BX+4], AX          ;MOVE OFFSET OF OVERFLOW TO 14CH
    MOV  AX, INT_SEG
    MOV  [BX+2], AX          ;MOVE SEGMENT BASE TO 14AH
    MOV  [BX+6], AX          ;MOVE SEGMENT BASE TO 14EH
    POP  DS                  ;RESTORE DS
    MOV  AL, 00000010B
    OUT  CONTROL, AL         ;ENABLE INPUT DEVICE
     .
     .
     .

If the interrupt pointers are to be set by the user's program, they could alternatively be set when the program is loaded by inserting the following directives at the beginning of the program:

                  INT_VEC    SEGMENT    AT   0
                        ORG   148H
                        DD    INT_ROUT
                        DD    OVERFLOW
                  INT_VEC    ENDS

On the other hand, for a program that continually receives new data and cannot suspend the input while processing a buffer at least two buffers are needed. Figure 6-13 gives a flowchart of how LINE_PROC could be structured when double buffering is required.

PRETHODNA FOLIJA SADRZAJ SLEDECA FOLIJA