1、Chg1 chg2 chg3 chg4 chg5 meamS1 78 85 55 100 97 S2 67 96 43 79 84 S3 92 55 76 92 65 S4 43 95 82 89 75 Aver 不计小数。25. 将两个磁盘文件合并成一个新的文件。26. 将一磁盘文件E:ASSFILE.ASM读入内存2000:0000h中,并将文件以反序形式(头尾对应字符互换) 仍以相同路径存入磁盘中。27. 在多模块设计中,主模块中调用内部模块buf1,buf2,buf3,buf4。主模块根据键盘输入的指令(如:a,b,c,d)调用上述对应的子程序,每个子程序的任务是显示其入口地址。调用后
2、继续等待调用,若输入ESC键(ASCII码为1BH)则结束程序的执行。请编写完成该任务的程序。28. 现有一控制程序共5个工序,要求输入0-4的序号,分别执行各工序的子程序,每个子程序的任务是显示其入口地址。调用后继续等待调用,按回车则结束程序的执行。29. 现有一组参量按16位编码,各字段的长度如下:BIT1=6, BIT2=4, BIT3=3, BIT4=3, BIT1位于高位, BIT4位于低位。设BIT1=52, BIT2=13, BIT3=5, BIT4=3请用程序编码将这些字段编码组合成一个字,按二进制的形式在屏幕上输出。30. 键盘输入十个数,分别同机0到9,10到99,100以
3、上的数的个数,并显示结果。1DATA SEGMENT BUF DB 0FFH DB ? DB 0FFH DUP (?) ANS DB 0DH,0AH,0FDH DUP (?DATA ENDSCODE SEGMENT ASSUME CS:CODE,DS:DATASTART: MOV AX,DATA MOV DS,AX LEA DX,BUF MOV AH,0AH INT 21H LEA SI,BUF2 MOV AL,BUF1 XOR AH,AH ADD SI,AX DEC SI LEA DI,ANS2 XOR CH,CH MOV CL,BUF1AGAIN: MOV AL,SI MOV DI,AL
4、INC DI LOOP AGAIN MOV BYTE PTRDI,$ LEA DX,ANS MOV AH,09H MOV AH,4CHCODE ENDS END START2 STROUT DB 0DH,0AH,A =000 DB 0DH,0AH,SPACE=000, MOV AX,DATA CMP BYTE PTRSI,A JNE NOTA CMP STROUT10,9 JE ATEN INC STROUT10 JMP NEXTATEN: CMP STROUT9, JE AHUN MOV STROUT10,0 INC STROUT9AHUN: MOV STROUT9, INC STROUT8
5、NOTA: JNE NOTSPACE CMP STROUT21, JE SPACETEN INC STROUT21SPACETEN: CMP STROUT20, JE SPACEHUN MOV STROUT21, INC STROUT20SPACEHUN: MOV STROUT20, INC STROUT19NOTSPACE:NEXT: INC SI LEA DX,STROUT3 STROUT DB 0DH,0AH,0FDH DUP(? LEA DI,STROUT2 JE SPACESPACE:4 STROUT DB 0DH,0AH,0FDH DUP (?B5 JNZ NOTA MOV WOR
6、D PTRDI,CC ADD DI,26 DB 0FFH DUP (? JB NOTUPZ JA NOTUP ADD AL,20HNOTUP: MOV AL,SI 7a JB NOTALPHAz JA NOTALPHANOTALPHA:8 BUF DB 05H DB 05H DUP (?datanametimefilecodepathuserexit DB 0DH,0AH,quittext REPLACE DB diskDATA,ES: MOV ES,AX LEA BX,STROUT2 LEADI,STROUT2 MOV CX,10 CLD PUSH CX MOV CX,4 REPZ CMPS
7、B POP CX JNZ NEXT LEA SI,REPLACE MOV DI,BX MOV DX,4SUBAGAIN: DEC DX JNZ SUBAGAIN JMP EXIT ADD BX,6EXIT: LEA DX,STROUT MOV AH,09h9 BUF DB 0DH,0AH,ramyesredthegetforandkeynotmay TMP DB ?STACK SEGMENT STACK DB 0FFH DUP(?STACK ENDSMAIN PROC NEAR LEA BX,BUF2 MOV DH,9AGAIN0: MOV SI,DI ADD SI,5 MOV DL,DHAG
8、AIN1: PUSH SI PUSH DI MOV CX,3 POP DI POP SI JA NOTABOVE MOV DI,SI JMP NEXT1 NOTABOVE:NEXT1: DEC DL JNZ AGAIN1NEXT0: CALL XCHGS3 ADD BX,5 DEC DH JNZ AGAIN0 MOV AH,4CH INT 21H MAIN ENDPXCHGS3 PROC NEARAGAINXCHGS3: MOV AH,DI MOV SI,AH INC DI LOOP AGAINXCHGS3 RETXCHGS3 ENDP10test DB 100 DUP (?DATA,SS:S
9、TACK MOV AX,STACK MOV SS,AX MOV DL,10 JE DEL ADD DI,7 JNZ AGAIN0DEL: CLD MOV AL,20H REP STOSB PUSH DX MOV BX,DX CMP BYTE PTRBX+2, JE NEXT1 POP DX ADD DX,7 LOOP AGAIN111 STRINSERT DB DW 0FFH DUP (? MOV DL,9 ADD SI,6 MOV DH,DL JA NEXT1 ADD SI,6 CALL XCHGS4 LEA BX,BUF2+6*10 LEA SI,STRINSERT LEA DI,BUF2AGAIN2: REP CMPSB JB SHIFTRIGHTNEXT2: ADD DI,6 JNZ AGAIN2SHIFTRIGHT: MOV AX,BX SUB
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1