DATA SEGMENT 
 MAS DB 20 DUP (?)
 MAS1 DB 20 DUP (?)
DATA ENDS
;
STACK SEGMENT
 DW 256 DUP(?)
STACK ENDS
;
CODS SEGMENT
    ASSUME SS:STACK,CS:CODS,DS:DATA
begin:
   MOV BX, DATA
   MOV DS, BX
 MOV AX, 0600H
 MOV BH, 07
 MOV CX, 0000
 MOV DX, 184FH
 INT 10H
  MOV AH, 02H
  MOV BH, 0
  MOV DH, 0
  MOV DL, 0
  INT 10H
  MOV DH, 5
  PUSH DX
MOV SI, 0
nachalo: MOV AH, 1
                      INT 21H
                      MOV MAS[SI], AL
                      CMP AL, '.'
                      JE metka
                      INC SI
                      JMP nachalo
metka: MOV SI, 0
           MOV CL, 0
           MOV DI, 0
nach:  MOV BL, MAS[SI]
          MOV MAS1[DI], BL
          CMP BL, '.'
          JE konec
          CMP BL, ' '
          JE metka1
          INC SI
          INC DI
          INC CL
          JMP nach
metka1:  SUB DI, 1
              MOV BL, MAS1[DI]
              CMP BL, 0ECH
              
              JE m1
              MOV BL, MAS1[DI]
              CMP BL, 0A8H
              
              JE m1
              MOV DI, 0
              INC SI
              MOV CL, 0
              JMP nach
m1:   SUB DI, 1
        MOV BL, MAS1[DI]
        CMP BL, 0E2H
        JE m2
        MOV DI, 0
        INC SI
        MOV CL, 0
        JMP nach
m2:    MOV DI, 0
          MOV CH, 0
          INC CL
                  MOV BL, CL
          MOV AH, 2
          MOV BH, 0
          POP DX
          ;MOV DL, 0
          ;MOV DH, 5
          INT 10H
begin1:  	MOV AH, 2
                  MOV DL, MAS1[DI]
                  INT 21H
                  INC DI
                  LOOP begin1
                  MOV AH, 3
                  INT 10H
                  PUSH DX
                  MOV DI, 0
;
                     MOV CL, BL
                     MOV CH, 0
   zachistka:   MOV MAS1[DI], ' '
                    INC DI
                    LOOP zachistka  
                    MOV DI, 0 
;                  
                  INC SI
                  MOV CL, 0
                   JMP nach
konec: SUB DI, 1
              MOV BL, MAS1[DI]
              CMP BL, 0ECH
              JE m11
              MOV BL, MAS1[DI]
              CMP BL, 0A8H
              JE m11
              JMP finish
m11:   SUB DI, 1
        MOV BL, MAS1[DI]
        CMP BL, 0E2H
        JE m22
        JMP finish
m22:   MOV DI, 0
          MOV CH, 0
          INC CL  
          MOV AH, 2
          MOV BH, 0
          POP DX
          ;MOV DL, 0
          ;MOV DH, 5
          INT 10H
begin11:  	MOV AH, 2
                  MOV DL, MAS1[DI]
                  INT 21H
                  INC DI
                  LOOP begin11
finish:
 MOV AX, 4C00H
    INT 21H
CODS ENDS
END begin