这段汇编程序有这个错误Operand must have size,应该怎么改啊?程序功能是算出正数负数和零的个数DSEG SEGMENTSAVE DB 3 DUP(?)NUM DW 100 DUP(?)DSEG ENDSCSEG SEGMENTASSUME CS:CSEG,DS:DSEGSTART:MOV AX,DSEGMOV DS,AXMOV CX,100XOR
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 00:19:07
这段汇编程序有这个错误Operand must have size,应该怎么改啊?程序功能是算出正数负数和零的个数DSEG SEGMENTSAVE DB 3 DUP(?)NUM DW 100 DUP(?)DSEG ENDSCSEG SEGMENTASSUME CS:CSEG,DS:DSEGSTART:MOV AX,DSEGMOV DS,AXMOV CX,100XOR
这段汇编程序有这个错误Operand must have size,应该怎么改啊?程序功能是算出正数负数和零的个数
DSEG SEGMENT
SAVE DB 3 DUP(?)
NUM DW 100 DUP(?)
DSEG ENDS
CSEG SEGMENT
ASSUME CS:CSEG,DS:DSEG
START:MOV AX,DSEG
MOV DS,AX
MOV CX,100
XOR BX,BX
XOR DX,DX
LEA SI,NUM
SUB SI,2
(这是错误的行数)NEx:ADD SI,2
CMP [SI],0
JNZ NZ
INC BL ;存放零的个数
JMP OK
NZ:TEST [SI],8000H
JNZ N
INC DH ;存放正数的个数
JMP OK
N:INC DL ;存放负数的个数
OK:LOOP NEx
MOV SAVE,DH ;将结果传送到内存保存
MOV SAVE+1,DL
MOV SAVE+2,BL
MOV AH,4CH
INT 21H
CSEG ENDS
END START
这段汇编程序有这个错误Operand must have size,应该怎么改啊?程序功能是算出正数负数和零的个数DSEG SEGMENTSAVE DB 3 DUP(?)NUM DW 100 DUP(?)DSEG ENDSCSEG SEGMENTASSUME CS:CSEG,DS:DSEGSTART:MOV AX,DSEGMOV DS,AXMOV CX,100XOR
CMP [SI],0 这句才不对
应该把[SI]付给一个寄存器里,再比较.