本人要求:把0的个数存入CH中,把1的个数存入CL中
最后并输出结果,最好是每句有详解
谢谢了,大哥大姐们了!!
DSEG SEGMENT
S1 DB ?
D2 DB ?
DSEG ENDS
CSEG SEGMENT
ASSUME CS:CSEG,DS:DSEG
START:MOV AX,DSEG
MOV DS,AX
MOV S1,0
MOV S2,0
MOV AX,1234h;给AX 赋值
MOV CX,16
SIGN:SHL AX,1
JC STEP1;若 CF=1
INC S1
MOV CL,S1
DEC CX
JCXNZ SIGN
STEP1:INC S2
MOV CH,S2
JCXNZ SIGN
DEC CX
MOV AH,4CH
INT 21H
CSEG ENDS
END START
我现在想从键盘上输入AX的值,要怎么办?并且样测出它的位数,赋给CX啊?