南开一百题答案

答案

1、40个字节,有符号,数组,分成正、负两数组,并求个数 (1)MOV (2)00H (3)JMP MAIN3 (4)LOOP (5)[SI] (6)MAIN4 (7)INC BX

2、10个无符号8位格雷码,转成二进制

(1)PUSH CX (2)RCL (3)BH

(4)JNE SET ONE (5)BH (6)AND BH,01H (7)POP CX

3、16位无符号数,排成升序

(1)2 (2)ADD DI,2 (3)NEXT0 (4)BX (5)SW (6)AX

(7)NEXT (8)DEC BX (9)JNZ 4、(x1+x2+x3+x4+x5)/5代替原数 (1)5 (2)CX (3)4

(4)MOV DX,0 (5)INC DI (6)INC SI 5、21个8位二有符号数,相邻之间差值不超过-8至7。进行压缩 (1)AL,[SI-2] (2)XOR BX,0FFH (3)Z (4)SHL (5)AND AL,0FH (6)DEC DX 6、将0~9的ASCII码转成二进制,并将SP转成$

(1)MOV SI,0 (2)MOV CX,N (3)MOV AL,SOURCE[SI] (4)10H (5)INC DI (6)INC SI (7)CHAN

7、对#和*之间的7个ASC码进行异或操作...... (1)JNZ (2)'*' (3)SEARCH1 (4)JNZ (5)13 (6)DEC BX 8、10个16位二进制,统计每个数中0的个数 (1)16 (2)SHL AX,1 (3)JB

(4)COUNT (5)BX,2 (6)[DI],DH 9、L做逻辑尺

(1)LEA DI,RESULT (2)1 (3)TEST (4)JP (5)SHL DX,1

10、求10个有符号字节的绝对值之和(字型),并到最大的数和地址 (1)NEG AL (2)ADC [DI+1] (3)ADC [DI+1] (4)NEXT (5)0FFH

11、对压缩BCD进行编码,是!则加BEH,CCH.....

(1)AND AH,0FH (2)PUSH CX (3)SHR AL,CL (4)AL,9 (5)BYTE PTR[DI],0BEH (6)LOOP CLP1 12、自动抄表,Y=X*70 X<=5.....

(1)MOV AL,[SI] (2)A (3)MUL BL (4)A (5)MUL BH (6)MUL DL (7)INC SI (8)ADD SI,2 13、Y=X*70 X<=10...

(1)MOV AL,[SI] (2)A (3)SUB AL,10

(4)ADD AX,10*70 (5)MOV [DI],AX (6)ADD DI,2 14、字符出现N次就用ESC,N,原字符三个字节来代替,压缩

(1)MOV AL,[DI] (2)REPNZ SCASB (3)INC DI (4)L0 (5)ADD SI,3 15、对上题进行解压

(1)E (2)STOSB (3)CLD

(4)MOV CX,[SI] (5)MOV AL,[SI+1] (6)REP STOSB (7)ADD SI,2 16、记录峰值

(1)XOR DX,AX (2)AND DH,80H (3)Z (4)MOV AL,[SI-2] (5)MOV DX,AX 17、取出负数并计算绝对值之和

(1)CMP AL,0 (2)NEXT (3)NEG AL (4)ADC DH,0 (5)REP STOSB 18、ASCII字符和汉字内码

(1)TEST (2)INC DI (3)REST11 (4)LASCⅡ (5)INC DL (6)[DI] (7)DH

19、故障报警,找0,有0则统计个数

(1)MOV AL,[SI] (2)8 (3)SHL (4)LP3 (5)LOOP (6)DH

(7)INC SI (8)DEC DL (9)LP1 20、窃水

(1)4 (2)INC DI (3)LP0

(4)0E1H (5)INC DI (6)JNZ 21、对非空格数据最高位清0

(1)AGN11 (2)ˊ#ˊ (3)INC DI (4)JMP AGN1 (5)20H (6)[DI] 22、ASCII转成偶校验码,累加码

(1)PUSH (2)ROL (3)ADC (4)BL, AL (5)POP (6)DX (7)MOV [DI],AL

23、红外通讯数据,BCD码AACC,DDEE (1)N (2)[SI] (3)JNZ NEXTD

(4)CMP AL,DH (5)ADD BX,DL (6)LOOP MCLP1 24、80个无符号字节,每8个求平均值

(1)DI,OFFSET RESULT (2)8 (3)AL

(4)LOOP MAGN2 (5)MOV CL,8 (6)DIV CL (7)MOV [DI],AL (8)INC DI (9)JNZ 25、在第4和5之间插00H,8和9之间插55H....

(1)MOV SI,0 (2)MOV AH,SOURCE[SI] (3)INC SI (4)AH (5)EXIT (6)POP SI (7)CHAN

26、在第4和5之间插00FFH.....

(1)MOV DI,0 (2)MOV RESULT[DI],AX (3)INC SI (4)INC DI (5)AX (6)DEC BX (7)4 (8)INC DI

27、在0~9的二进制转成ASCII,在1,5...插\ (1)MOV SI,0 (2)4 (3)INC DI

(4)ADD AL,30H (5)INC SI (6)INSER1 28、ASCII转成BCD...奇数 (1)AL (2)AL (3)4 (4)CL (5)OR

29、ASCII转成个位二进制,最后存和 (1)0 (2)SUB (3)INC DI

(4)DAA (5)DEC CX (6)MOV [DI],DL 30、小写转成大写,并统计'z'的个数 (1)JB (2)NINC (3)20H

(4)JUMP (5)INC DI (6)MOV [DI],DL 31、16位二进制,对高位和低位进行逻辑与及或运算 (1)SOURCE[BX] (2)DL (3)OR (4)AL (5)MOV [DI],AX (6)DEC CX 32、16进制数转成ASCCII,先高4位... LEA SI,SOURCE LEA DI,RESULT MOV CX,N LOOP2: MOV BL,2 MOV AL,[SI] MOV AH,AL PUSH CX MOV CL,4 SHR AL,CL POP CX EXCH: CMP AL,9 JNA CHAR ADD AL,07H CHAR: ADD AL,30H MOV [DI],AL INC DI DEC BL JZ LOOP1 AND AH,OFH MOV AL,AH JMP EXCH LOOP1: INC SI

LOOP LOOP2

33、在ASCII串的每个字符在最高位加上奇校验位 LEA SI,SOURCE LEA DI,RESULT LOOP2: MOV AL,[SI] CMP AL,00H JE EXIT ADD AL,0 JNP LOOP1 OR AL,80H LOOP1: MOV [DI],AL INC DI INC SI

JMP LOOP2 EXIT: MOV [DI],AL 34、 大写全变成小写 LEA SI,SOURCE LEA DI,RESULT LOOP1: MOV AL,[SI] CMP AL,00H JE EXIT CMP AL,41H JB KEEP

CMP AL,5AH

JNBE KEEP ADD AL,20H KEEP: MOV [DI],AL INC DI INC SI

JMP LOOP1 EXIT: MOV [DI],AL 35、 去掉为负的奇数 LEA SI,SOURCE LEA DI,RESULT MOV CX,20 LOOP1:MOV AL,[SI] MOV AH,AL SHR AH,1 JNC KEEP CMP AL,0 JNL KEEP JMP EXIT

KEEP: MOV [DI],AL INC DI EXIT: INC SI

LOOP LOOP1

36、串有连续的字符仅用一个字符代替 LEA SI,SOURCE LEA DI,RESULT LOOP1:MOV AL,[SI] CMP AL,00H JE EXIT NEXT: INC SI

MOV AH,[SI] CMP AL,AH JE NEXT MOV [DI],AL INC DI

JMP LOOP1 EXIT: MOV [DI],AL

37、对每个数进行右移,直到最低位为1 (1)0 (2)TEST (3)NZ (4)SHR (5)LOOP NEXT 38、统计每个数中二进制数中1的个数 (1)W (2)MOV BX,0 (3)NB (4)LOOP1 (5)INC DI

39、BCD码转成ASCII,并在最高位加偶校验位

(1)AL,[SI] (2)SHR AL,CL (3)POP CX (4)JP SERCH2 (5)ADD AH,30H (6)LOOP 40、无符号Ck=Ak除Bk

(1)MOV CX,N (2)DL,SOURCE[BX+N] (3)MOV AX (4)DL (5)AX (6)INC BX (7)JNZ

41、16个10位二进制,DB9~DB0 000000 转成DB7~DB0 000000 DB9 DB8 (1)BYTEPTR SOURCE[BX]+1(2)CL (3)CL (4)AH (5)AL 42、无符号字节,排成升序

(1)INC DI (2)NEXT0 (3)N-1 (4)SB (5)NEXT3 (6)AL

(7)NEXT2 (8)BX (9)NEXT1 43、ASCII转成压缩BCD码

(1)B (2)0FH (3)B (4)CX (5)4 (6)CX (7)BL (8)B

44、BCD转成ASCII,高位BCD放高地址 (1)B (2)0FH (3)B (4)BL (5)CX (6)4 (7)CX (8)B 45、无符号Ck=Ak+Bk

(1)OFFSET RESULT (2)0 (3)MOV CX,N

(4)ADD AL,SOURCE[BX] (5)ADC AH,0 (6)ADD DI,2 46、有符号Ck=Ak-Bk

(1)SUB AL,SOURCE[BX+N] (2)JNS (3)0FF H (4)JUMP1 (5)JUMP 1 (6)CBW 47、无符号Ck=Ak*Bk

(1)MOV DI (2)MOV CX,N (3)MOV AL (4)MUL SOURCE[BX] (5)DEC CX 48、摇号机,统计0~9出现的次数

(1)MOV AL,AH (2)AND AH,0F0H (3)SHR (4)INC RESULT[BL] (5)INC RESULT[BL] 49、摇号机,两号码相加为2,3,4,5,6,7,8的次数

(1)BX (2)SHR (3)AH

(4)BL , AL (5)SUB (6)INC RESULT[BX] 50、有符号Ck=Ak+Bk

(1)SOURCE[BX+N] (2)ADD (3)0FFH (4)JUMP (5)CBW

51、16个12位二进制DB11~DB0 0000转成DB7~DB0 0000 DB11~DB8 (1)4 (2)SOURCE[BX] (3)CL (4)CL (5)CL (6)AH,AL (7)AL (8)AH

52、10个无符号,近似法求近似平方根

(1)INC BX (2)JBE (3)INC BX (4)SHR BX,1 (5)INC DI (6)INC SI 53、有符号8位二进制,排成正负相间,负数排第一个 (1)80H (2)AL, BL (3) BL (4)DEC

54、对内存中7个ASCII字符组成的字符串进行如下操作,在源串前加#,后加*,再放原异或的结果.... (1)’# ’ (2)00H (3)CHAR (4)’* ’ (5)0DH (6)0AH (7)EXIT

55、无符号Ck=Ak-Bk

(1)MOV CX,N (2)SOURCE[BX+N] (3)JNC (4)0FFH (5)[DI]

56、I*J矩阵转置,并计算每一行元素之和

(1)ADC CH,0 (2)CMP DX,I (3)ADD DI,2 (4)INC BX (5)LPJ

57、Y[n]=Y[n-1]+delta if X[n]>Y[n-1]+delta...... (1)[DI-1] (2)NA (3)MOV [DI],BX

(4)NB (5)MOV [DI],AL (6)MOV [DI],DX 58、说明已过峰值,记录当前值

(1)XOR BX,DX (2)AND BX,80H (3)Z (4)STOSB (5)INC DI

59、ASCII,如果是0~9或A~F之间转成二进制 (1)MOV (2)MOV CX,N (3)’9’

(4)STRIP (5)’F’ (6)INVALID (7)NEXT

60、20个无符号数,求它们的和(字型)

(1)MOV AH,0 (2)ADD BX,AX (3)AL (4)INC SI (5)INC DI (6)BX 61、有符号字节Ck=Ak*Bk,Ck按有符号字的型式

(1)OFFSET RESULT (2)MOV BX,N (3)SOURCE[BX+N] (4)IMUL (5)DI,2 (6)DEC BX

62、DB11~DB0 0000 判别是否大于800H,若大于,存入01H,否则存00H,最后存放大于的个数 (1)OFFSET RESULT (2)8000 H (3)C_0 (4)CL

63、大写转小写统计A的个数

(1)JB (2)’Z’ (3)NINC

(4)20H (5)INC DI (6)MOV [DI],DL 64、ASCII转成无符号二进制再统计大于等于5的个数 (1)00H (2)30H (3)JB (4)DL (5)MOV [DI],DL

65、统计成绩,100~90...69~60以及低于60的人数,并计算30个学生的平均成绩 (1)CLD (2)MOV AH,0 (3)CMP AL,90 (4)BYTE PTR[DI+4] (5)JMP NEXT (6)BX (7)N

66、删除10个无符号字节跌最大值和最小值,并计算算术平均值 (1)[SI] (2)[SI] (3)NEXT

(4)JL NEXT (5) N (6)INC AL 67、20个16位有符号,求出最小值和最大值

(1)MOV DX,[SI] (2)MOV CX,N-1 (3)CHKMIN (4)JGE (5)MOV [DI],DX (6)MOV [DI],BX 68、大字转小写,其它转'SP'

(1)LEA DI,RESULT (2)[SI] (3)’Z’ (4)JA (5)20H (6)INC SI (7)DI (8)LOOP 69、8位有符号,Ci=|Ai+Bi|

(1)N (2)SOURCE[BX+N] (3)SOURCE[BX] (4)0FFH (5)JUMP (6)CBW (7)JNS

70、取出N阶矩阵对角线上的元素,并计算累加值 (1)AL (2)MOV AH,0 (3)SOURCE (4)ADC CH,0 (5)N+1

71、判断前9个字节是否为偶校验码,若是则转ASCII,否07H.再计算累加码并比较,相等存06H,否07H (1)PUSH (2)JNE (3)BL ,0FH (4)POP (5)CMP [SI],AL 72、无符号8位二进制转格雷码

(1)PUSH CX (2)ROL (3)ADC AH,0 (4)JNE (5)BH (6)POP CX

73、Yk=[(Y|n+3 - Y|n)/3]*(k-n) +Yn,k=n+1、n+2.n=0,3,6,9 非线性温度传感器分段线性插值法。 (1)MOV DL,3 (2)PUSH AX (3)BH (4)AL (5)POP AX (6)2

74、N个有符号数找最大值,存入,其后为原N个数取反 (1)LEA (2)[BX] (3)CMP

(4)JG MAXD3 (5)MAXD2 (6)STOSB 75、无符号字节,Ck为Ak和Bk异或运算的结果

(1)CX,N (2)DI,OFFSET RESULT (3)SOURCE[BX+N] (4)[DI],AL (5)INC BX

76、10个无符号字节,高4位和低4位转成ASCII,按照先低后高存 (1)0FH (2)CL (3)POP CX (4)30H (5)ENDP 77、计算10*3矩阵每一行元素之和 (1)MOV AH,0 (2)SI (3)J (4)AX (5)2

78、计算10*3矩阵每一列元素之和 (1)MOV AH,0 (2)J (3)2 (4)INC BX (5)J

79、在递增有序数组中插入一个正整数。如将02H插入到01H,03H,04H...中 (1)AL (2)DL (3)SI

(4)[BX+SI+1] (5)REP

80、四组带符号8位二进制,当每组中负多于正时,正变负,反之,负变正. (1)4 (2)JG (3)NEXT

(4)JAE (5)0 (6)NOTNEG1 (7)JZ EXIT 81、小写转成大写

(1)UPPER2 (2)’Z’ (3)A (4)AL,0DFH (5)AL (6)SI (7)DI (8) LOOP

82、有符号字节,Ck=Ak/Bk,结果低字节为商,高为余数

(1)MOV BX,0 (2)OFFSET RESULT (3)SOURCE[BX] (4)CBW (5)IDIV (6)[DI]

83、16个10位无符号DB9~DB0 000000 判别是否<=200H,若小存01H,否存00H.最后存<=的个数 (1)0 (2)BYTE PTR SOURCE[BX+1](3)8000H (4)DH (5)CL (6)INC DI

84、10个字节,统计每个数中位为1的个数存入,最后存入1位数的总数 (1)8 (2)ROL AL,1 (3)JUMP (4)JNZ (5)DL (6)[DI],DH 85、将串中0DH,0AH换成0DH以00结尾

(1)CMP AL,00H (2)JE QUIT (3)E (4)L0 (5)INC SI

86、20个无符号数组A,求新组B。B(I)=A(I),I=1,20。 B(I)=(A(I-1)+2*A(I)+A(I+1)/4),I=2~19. (1)MOV AL,[SI+N-1] (2)MOV [DI+N-1],AL (3)N-2 (4)[SI] (5)[SI-1] (6)[SI+1] (7)SHL

87、有符号字节数据除以5,并按四舍五入的原则将商存入 (1)AND AH,80H (2)NEG AH (3)NEXT (4)AH,AH (5)ADD AL,1

88、对10个无符号数进行升序排序,剔除头尾,计算其余的算术平均值,4舍5入存在最后 (1)N (2)DEC BX (3)CMP BX,0

(4)N-2 (5)MOV DL,N-2 (6)ADD AL,1

89、分别统计内存中字符串SEGMENT、EQU等个数,以字节形式存入

(1)STR0,N1,RESULT[0] (2)STR1,N1,RESULT[1] (3)STR2,N1,RESULT[2] (4)STR3,N1,RESULT[3] (5)STR4,N1,RESULT[4] (6)STR5,N1,RESULT[5] (7)STR6,N1,RESULT[6] (8)STR7,N1,RESULT[7] (9)STR8,N1,RESULT[8] (10)STR9,N1,RESULT[9]

90、无符号字节序列,求最大值最小值。先存入原数,再存最大值、最小值 (1)DI (2)1 (3)ADD DI,1 (4)JNA (5)BL (6)BH (7)MOV [DI+1],BL

91、对10个字节进行加密,高位A>=低位B,则B=A-B;A

(1)DEC DX (2)JAE G1 (3)AL

(4)SHL (5)OR

92、6组有符号16位二进制,当每组中负多于正,则负变正.反之,则正变负. (1)MOV CX,6 (2)ADD SI,2 (3)JMP

(4)ADD SI,2 (5)NEG AX (6)ADD DI,2 (7)ADD SI,2 (8) ADD DI,2 (9) JMP REPT1

93、20个有符号字节序列,求最大值和最最小值,先存原数,最后存最大值和最小值 (1)DI (2)1 (3)ADD DI,1

(4)JNG (5)BL (6)MOV [DI],BH (7)INC DI (8) BL

94、对信号进行低通滤波Yi=(15*Yi-1/16)+(Xi/16),Y0=0 (1)BX (2)ADD (3)SUB

(4)MOV BX,AX (5)INC DI (6)INC SI

95、 20个有符号,>=+64用'>'表示,0<数<+64用'+'表示,=0用'0'表示........ LEA SI,SOURCE LEA DI,RESULT

MOV CX,N NEXT: MOV AL,[SI] CMP AL,64 JGE LP1 CMP AL,0 JG LP2 JE LP3

CMP AL,-64 JG LP4 MOV AL,'<' JMP SAV LP1: MOV AL JMP SAV LP2: MOV AL,'>' JMP SAV LP3: MOV AL,'0' JMP SAV LP4: MOV AL,'-' SAV: MOV[DI],AL INC SI INC DI

LOOP NEXT

96、在有序递增数组中删掉一个指字的数,数组最后元素填0 (1)REPNZ (2)DI (3)MOVSB (4)00H (5)MOV CX,N

97、Yn=Xn+5 Xn<-5;Yn=0 |Xn|<=5;Yn=Xn-5 Xn>5; (1)MOV CX,N (2)L (3)A

(4)INC SI (5)INC DI (6)LOOP NEXT

98、加密10个字节,高位与前一个字节低位交换,低位与后一字节的高位交换 (1)JNZ LW (2)PUSH (3)POP (4)RESULT[DI] (5)SOURCE[SI] 99、大写转小写,其余不变

(1)LOWER2 (2)’Z’ (3)A

(4)OR AL,20H (5)AL (6)INC SI (7)DI (8) LOOP

100、20个8位有符号数(补码)Yn=-100 Xn<-100;Yn=Xn |Xn|<=100;Yn=100 (1)MOV CX,N (2)L (3)JNG STORE

(4)INC SI (5)INC DI (6)LOOP NEXT

Xn>100

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4