Home > other >  For bosses to analyse the flow chart, cannot have system thinking method. Delete the repeated charac
For bosses to analyse the flow chart, cannot have system thinking method. Delete the repeated charac

Time:09-18

The DATA SEGMENT
STRN DB 80 DUP (?)
LEN DB?
The DATA ENDS
CODE SEGMENT
ASSUME CS: CODE, DS: DATA, ES: DATA
START: MOV AX, DATA
MOV DS, AX
MOV ES, AX
LEA SI, STRN
MOV CL, 0
AGAIN: MOV AH, 1; The input characters
INT 21 h
CMP AL, 0 dh; Character is the enter
JZ DONE; Is that jump DONE
MOV [SI], AL; No, in AL content delivery storage unit to SI points to
INC SI
INC CL; Record number of characters
JMP AGAIN
DONE: MOV CH, 0; CX deposit characters
MOV LEN, CL; Will be in the CL content transmitted to LEN
DEC SI
REPET: PUSH SI
PUSH CX. CX, save the CX inner loop count
PUSH CX. CX value will be passed to DX, DX cycle count
POP DX
DEC CX
JE NEXT1; Is the last one character at a time, no longer find duplicate characters
MOV AL, [SI]
CMP AL, 0
JE NEXT1
COMP: DEC SI
CMP AL, [SI]
Developed GOON. Not equal to the repeated characters
MOV BYTE PTR [SI], 0
GOON: LOOP COMP; Found out and the character repeat all of the characters, and 0 to replace
NEXT1: POP DX
POP SI
DEC SI
DEC DX
CX, MOV DX
JNZ REPET; To find all the characters
LEA SI, STRN; Remove duplicate characters
MOV CL, LEN
MOV CH, 0
MOV [SI + LEN - 1], '$'
INC CL
CYCLE: MOV AL, [SI]
CMP AL, 0; Is repeated characters?
JNZ NEXT; No, find next character
DEC CX. Alternates string length to CX
JZ DONE1; If the last character remain empty
CALL DELE. Remove the null character and are available
DEC SI; To process alternates substring from
CX
INC.NEXT: INC SI
The LOOP CYCLE
DONE1: MOV AH, 2
Dh MOV DL, 0
INT 21 h
MOV DL, ah 0
INT 21 h
LEA DX, STRN
MOV AH, 9
INT 21 h
MOV AH, 4 ch
INT 21 h
DELE PROC
PUSH SI
PUSH CX
CLD
MOV DI SI; Null character for the purpose of the first address
INC SI
REP MOVSB; Under an address for the source string first address
POP CX
POP SI
RET
DELE ENDP
CODE ENDS
END the START

CodePudding user response:

System thinking method will not be able to have?
  • Related