home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol7n10.zip / INFO.ASM next >
Assembly Source File  |  1988-05-31  |  4KB  |  90 lines

  1. ;*--------------------------------------------------------------------*
  2. ;*   INFO.COM -- A DIFFERENT PAUSE FOR BATCH JOBS -- by Hal Shearer   *
  3. ;*--------------------------------------------------------------------*
  4. ;*              FORMAT:    INFO [40 CHARACTER MESSAGE]                *
  5. ;*--------------------------------------------------------------------*
  6. CSEG    SEGMENT
  7.     ASSUME    CS:CSEG,DS:CSEG
  8.     ORG    100H
  9. START:    JMP    INIT
  10. STORE    DB    ?
  11. MSG    DB    40 DUP ('.')
  12. BUFFER    DB    'Response needed: PRESS ANY KEY TO ADVANCE'
  13.     DB    40 DUP ('.'),'$'
  14. INIT:
  15.     PUSH    SI            ;save registers SI
  16.     PUSH    DI            ;and DI                        
  17.     MOV    SI,80H            ;point SI to the text          
  18.     CLD                ;go forward                    
  19.     CALL    SPACE            ;parse the spaces              
  20.     CMP    BYTE PTR [SI],13    ;is it a carriage control?     
  21.     JE    XXX            ;yes - then jump               
  22.     MOV    CX,40            ;no, place 40 into CX          
  23.     LEA    DI,BUFFER        ;point buffer to DI            
  24. X:    LODSB                ;get character from SI to AL   
  25.     CMP    AL,13            ;is it a carriage control char?
  26.     JE    XX            ;yes, then exit                
  27.     STOSB                ;no, store it in the buffer    
  28.     LOOP    X            ;do process again until CX is 0
  29. XX:    INC    CX            ;change carriage control to '.' 
  30.     MOV    AL,'.'            ;place a period in AL          
  31. REP    STOSB                ;repeat the store until CX is 0
  32. XXX:    POP    DI            ;restore registers DI          
  33.     POP    SI            ;and SI                        
  34.     MOV    AH,1            ;turn the cursor off           
  35.     MOV    CX,0F00H        ;with this address             
  36.     INT    10H                                                    
  37. WAIT:    MOV    AH,2            ;place the cursor here         
  38.     MOV    DH,24            ;at row 24                     
  39.     MOV    DL,19            ;column 00                     
  40.     INT    10H                                                    
  41. AGAIN:    MOV    STORE,-1        ;set value to -1               
  42. INCR:    ADD    STORE,1            ;increment the value           
  43.     MOV    BL,STORE        ;place it into BL              
  44.     MOV    BH,0            ;ready BX to be the index      
  45.     MOV    CX,39            ;going to do this 80 times     
  46.     CALL    POS_CURSOR        ;position cursor               
  47. LOOP1:    MOV    AL,MSG[BX]        ;put byte from msg area in AL  
  48.     MOV    AH,14            ;set up for teletype print    
  49.     INT    10H                                                    
  50.     INC    BX            ;increment the index           
  51.     CALL    PAUSE            ;lets wait awhile              
  52.     MOV    AH,1            ;check for a key depression    
  53.     INT    16H                                                    
  54.     JZ    SKIP            ;if not skip it                
  55.     JMP    EXIT            ;if so exit now                
  56. SKIP:    LOOP    LOOP1            ;loop back until CX is zero    
  57.     CMP    MSG[BX],'$'        ;is the msg area at the end?   
  58.     JE    AGAIN            ;yes, then go again            
  59.     JMP    INCR            ;go back and start all over    
  60. SPACE:    INC    SI            ;find first char in the text   
  61.     CMP    BYTE PTR [SI],32    ;is it a space?               
  62.     JZ    SPACE            ;if so do it again             
  63.     RET                ;return                        
  64. POS_CURSOR:                ;position the cursor           
  65.     PUSH    BX            ;save BX register              
  66.     MOV    AH,2            ;set up to move cursor         
  67.     MOV    DH,24            ;start in row 24               
  68.     MOV    DL,19            ;and column 00                 
  69.     INT    10H                                                    
  70.     POP    BX            ;restore BX                    
  71.     RET                ;return                        
  72. PAUSE:    PUSH    CX            ;save CX                       
  73.     MOV    CX,600            ;loop 300 times for pause      
  74. BACK:    LOOP    BACK            ;loop til CX is zero           
  75.     POP    CX            ;restore CX                    
  76.     RET                ;return                        
  77. EXIT:    CALL    POS_CURSOR        ;prepare to erase the message 
  78.     MOV    CX,79                                                  
  79. EXIT2:    MOV    AL,' '            ;place a blank into AL         
  80.     MOV    AH,14            ;prepare to teletype char      
  81.     INT    10H                                                    
  82.     LOOP    EXIT2            ;loop til CX is zero           
  83.     MOV    AH,1            ;restore the cursor            
  84.     MOV    CH,11            ;part of cursor in CH          
  85.     MOV    CL,12            ;the rest goes here in CL      
  86.     INT    10H                                                    
  87.     INT    20H            ;return to DOS
  88. CSEG    ENDS
  89.     END    START
  90.