;统计一个256个字节的内存块中一共有多少个1,并存储在一个名为COUNT的字中 DATA SEGMENT BUF DB 12H,23H,…… COUNT DW ? DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,CODE MOV DS,AX XOR BX,BX MOV CX,256 LEA SI,BUF REP0: MOV DH,7 REP1: CMP [SI],0 JL REP2 JE REP3 INC BX REP2: DEC DH JNZ REP1 REP3: INC SI LOOP REP0 MOV COUNT,BX MOV AH,4C INT 21H CODE ENDS END START ;将一个以0结尾的字符串中的大写字母换成小写 DATA SEGMENT STR DB 'How are YoU!',0 DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX LEA SI,STR AGAIN: MOV AL,[SI] CMP AL,0 JE EXIT CMP AL,'A' JB OK CMP AL,'Z' JA OK ADD AL,20H MOV [SI],AL OK: INC SI JMP AGAIN EXIT: MOV AH,4CH INT 21H CODE ENDS END START