home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / DISPCDOS.MOD < prev    next >
Text File  |  1988-01-06  |  6KB  |  128 lines

  1. (*----------------------------------------------------------------------*)
  2. (* Display_Character_Through_DOS --- show character received from port  *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Display_Character_Through_DOS( Ch: CHAR );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Display_Character_Through_Dos                        *)
  10. (*                                                                      *)
  11. (*     Purpose:    Displays character received from comm. port on       *)
  12. (*                 screen/printer/capture file.                         *)
  13. (*                                                                      *)
  14. (*     Calling Sequence:                                                *)
  15. (*                                                                      *)
  16. (*        Display_Character_Through_Dos( Ch : CHAR );                   *)
  17. (*                                                                      *)
  18. (*           Ch         --- Character received from Comm. port.         *)
  19. (*                                                                      *)
  20. (*      Calls:   Capture_Char                                           *)
  21. (*               Update_Review_Pointers                                 *)
  22. (*                                                                      *)
  23. (*----------------------------------------------------------------------*)
  24.  
  25. VAR
  26.    I    : INTEGER;
  27.  
  28. BEGIN (* Display_Character_Through_DOS *)
  29.  
  30.                                    (* Select display depending on *)
  31.                                    (* character.                  *)
  32.    CASE ORD( Ch ) OF
  33.  
  34.       CR   :       IF Add_LF THEN
  35.                       BEGIN
  36.  
  37.                          IF Capture_On THEN
  38.                             Capture_Char( CHR( LF ) );
  39.  
  40.                          IF Printer_On THEN
  41.                             BEGIN
  42.                                Write_Prt( CHR( CR ) );
  43.                                Write_Prt( CHR( LF ) );
  44.                             END;
  45.  
  46.                          INLINE(
  47.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  48.                                 /$B2/<CR {  MOV    DL,<CR  ;Character to display}
  49.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  50.                                );
  51.  
  52.                          INLINE(
  53.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  54.                                 /$B2/<LF {  MOV    DL,<LF  ;Character to display}
  55.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  56.                                );
  57.  
  58.                          IF Review_On THEN
  59.                             Update_Review_Pointers;
  60.  
  61.                       END
  62.                    ELSE
  63.                       BEGIN
  64.  
  65.                          INLINE(
  66.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  67.                                 /$B2/<CR {  MOV    DL,<CR  ;Character to display}
  68.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  69.                                );
  70.  
  71.                          IF Printer_On THEN
  72.                             Write_Prt( CHR( CR ) );
  73.  
  74.                       END;
  75.  
  76.       LF   :       IF NOT Add_LF THEN
  77.                       BEGIN
  78.                          IF Capture_On THEN
  79.                             Capture_Char( CHR( LF ) );
  80.                          INLINE(
  81.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  82.                                 /$B2/<LF {  MOV    DL,<LF  ;Character to display}
  83.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  84.                                );
  85.                          IF Printer_On THEN
  86.                             Write_Prt( CHR( LF ) );
  87.                          IF Review_On THEN
  88.                             Update_Review_Pointers;
  89.                       END;
  90.  
  91.       VT, FF:      BEGIN
  92.                       IF Capture_On THEN
  93.                          Capture_Char( Ch );
  94.                       IF Printer_On THEN
  95.                          Write_Prt( Ch );
  96.                       INLINE(
  97.                               $B4/$02     {  MOV    AH,2        ;DOS display character function}
  98.                              /$8A/$56/<CH {  MOV    DL,[BP+<Ch] ;Character to display}
  99.                              /$CD/$21     {  INT    $21         ;Call DOS}
  100.                             );
  101.                       IF Review_On THEN
  102.                          Update_Review_Pointers;
  103.                    END;
  104.  
  105.       ELSE         BEGIN
  106.  
  107.                       INLINE(
  108.                               $B4/$02     {  MOV    AH,2        ;DOS display character function}
  109.                              /$8A/$56/<CH {  MOV    DL,[BP+<Ch] ;Character to display}
  110.                              /$CD/$21     {  INT    $21         ;Call DOS}
  111.                             );
  112.  
  113.                       IF Capture_On THEN
  114.                          Capture_Char( Ch );
  115.  
  116.                       IF Printer_On THEN
  117.                          Write_Prt( Ch );
  118.  
  119.                       IF Review_On THEN
  120.                          IF ( LENGTH( Review_Line ) < Max_Review_Line_Length ) THEN
  121.                             Review_Line := Review_Line + Ch;
  122.  
  123.                    END;
  124.  
  125.       END;
  126.  
  127. END   (* Display_Character_Through_Dos *);
  128.