CPU与汇编实验五实验报告 下载本文

MOV CX,10 L2:

MOV AL,[SI]

MUL BL ;变成实际数字 ADD AL,[SI+1] MOV [SI],AL ADD SI,3 LOOP L2 RET

change endp

paixu proc near ;LEA SI,BUF ADD SI,2 LEA DI,BUF ADD DI,5 MOV CX,10 MOV AL,[SI] L3: MOV DI,CX MOV BX,2 L4:

MOV AL,BUF[BX]

排序 CMP AL,BUF[BX+3] JBE CONTINUE XCHG AL,BUF[BX+3] MOV BUF[BX],AL CONTINUE: ADD BX,3 LOOP L4 MOV CX,DI LOOP L3 RET

paixu endp

output16 proc near;显示16进制数字 MOV CL,4 MOV DL,AL SHR DL,CL MOV BIAO,AX CALL exchange MOV AX,BIAO MOV DL,AL AND DL,0FH CALL exchange RET

output16 endp exchange proc near CMP DL,9 JA NOTDIG OR DL,30H JMP FINAL NOTDIG: ADD DL,37H FINAL: MOV AH,02H INT 21H RET

exchange endp kongge proc near MOV DL,20H MOV AH,02H INT 21H RET kongge endp CODES ENDS END START (3)、实验结果

4、英文人名排序 (1)、流程图

否 输入一个字符串

开始 否 是否为第一个字符串? 与已经输入的字符串比较排序