各位好!请帮我看看这程序是什么意思,感谢!
各位好,我是汇编新手,现有一程序,请大家给解释一下,每句都要解释,谢谢了!!我的QQ:83508710程序如下:
SSEG SEGMENT STACK
DW 64 DUP(?)
SSEG ENDS
DATA SEGMENT
S1 DB 128,129 DUP(0)
S2 DB 128,129 DUP(0)
PRINT1 DB 'input s1',10,13,'$'
PRINT2 DB 'input s2',10,13,'$'
ERROR1 DB 'N$'
ERROR2 DB 's2>s1$'
ERROR3 DB 's1=0$'
ERROR4 DB 'S2=0$'
Y DB 'Y$'
DISP DB 10,13,'$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:SSEG,ES:DATA
MAIN: MOV AX,DATA
MOV DS,AX
MOV ES,AX
START: LEA DX,PRINT1
MOV AH,9
INT 21H
LEA DX,S1
MOV AH,10
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
LEA DX,PRINT2
MOV AH,9
INT 21H
LEA DX,S2
MOV AH,10
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
XOR BX,BX
XOR CX,CX
MOV CL,[S1+1]
MOV BL,[S2+1]
CMP CL,BL
JB ERR2
CMP CL,0
JE ERR3
CMP BL,0
JE ERR4
MOV SI,OFFSET S1+2
MOV DI,OFFSET S2+2
SUB CX,BX
INC CX
MOV BX,SI
MOV DX,DI
CLD
LAB: MOV SI,BX
MOV DI,DX
PUSH CX
XOR CX,CX
MOV CL,[S2+1]
REPZ CMPSB
JZ TURE
INC BX
POP CX
LOOP LAB
ERR1: LEA DX,ERROR1
MOV AH,9
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
JMP S
ERR2: LEA DX,ERROR2
MOV AH,9
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
JMP S
ERR3: LEA DX,ERROR3
MOV AH,9
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
JMP S
ERR4: LEA DX,ERROR4
MOV AH,9
INT 21H
LEA DX,DISP
MOV AH,9
INT 21H
JMP S
TURE: LEA DX,Y
MOV AH,9
INT 21H
S: LEA DX,DISP
MOV AH,9
INT 21H
JMP START
CODE ENDS
END MAIN