31、16位二進(jìn)制,對(duì)高位和低位進(jìn)行邏輯與及或運(yùn)算
(1)SOURCE[BX] (2)DL (3)OR
(4)AL (5)MOV [DI],AX (6)DEC CX
32、16進(jìn)制數(shù)轉(zhuǎn)成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串的每個(gè)字符在最高位加上奇校驗(yàn)位
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、 去掉為負(fù)的奇數(shù)
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、串有連續(xù)的字符僅用一個(gè)字符代替
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、對(duì)每個(gè)數(shù)進(jìn)行右移,直到最低位為1
(1)0 (2)TEST (3)NZ
(4)SHR (5)LOOP NEXT
38、統(tǒng)計(jì)每個(gè)數(shù)中二進(jìn)制數(shù)中1的個(gè)數(shù)
(1)W (2)MOV BX,0 (3)NB
(4)LOOP1 (5)INC DI
39、BCD碼轉(zhuǎn)成ASCII,并在最高位加偶校驗(yàn)位
(1)AL,[SI] (2)SHR AL,CL (3)POP CX
(4)JP SERCH2 (5)ADD AH,30H (6)LOOP
40、無(wú)符號(hào)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個(gè)10位二進(jìn)制,DB9~DB0 000000 轉(zhuǎn)成DB7~DB0 000000 DB9 DB8
(1)BYTEPTR SOURCE[BX]+1(2)CL (3)CL
(4)AH (5)AL
42、無(wú)符號(hào)字節(jié),排成升序
(1)INC DI (2)NEXT0 (3)N-1
(4)SB (5)NEXT3 (6)AL
(7)NEXT2 (8)BX (9)NEXT1
43、ASCII轉(zhuǎn)成壓縮BCD碼
(1)B (2)0FH (3)B
(4)CX (5)4 (6)CX
(7)BL (8)B
44、BCD轉(zhuǎn)成ASCII,高位BCD放高地址
(1)B (2)0FH (3)B
(4)BL (5)CX (6)4
(7)CX (8)B
45、無(wú)符號(hào)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、有符號(hào)Ck=Ak-Bk
(1)SUB AL,SOURCE[BX+N] (2)JNS (3)0FF H
(4)JUMP1 (5)JUMP 1 (6)CBW
47、無(wú)符號(hào)Ck=Ak*Bk
(1)MOV DI (2)MOV CX,N (3)MOV AL
(4)MUL SOURCE[BX] (5)DEC CX
48、搖號(hào)機(jī),統(tǒng)計(jì)0~9出現(xiàn)的次數(shù)
(1)MOV AL,AH (2)AND AH,0F0H (3)SHR
(4)INC RESULT[BL] (5)INC RESULT[BL]
49、搖號(hào)機(jī),兩號(hào)碼相加為2,3,4,5,6,7,8的次數(shù)
(1)BX (2)SHR (3)AH
(4)BL , AL (5)SUB (6)INC RESULT[BX]
50、有符號(hào)Ck=Ak+Bk
(1)SOURCE[BX+N] (2)ADD (3)0FFH
(4)JUMP (5)CBW
51、16個(gè)12位二進(jìn)制DB11~DB0 0000轉(zhuǎn)成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個(gè)無(wú)符號(hào),近似法求近似平方根
(1)INC BX (2)JBE (3)INC BX
(4)SHR BX,1 (5)INC DI (6)INC SI
53、有符號(hào)8位二進(jìn)制,排成正負(fù)相間,負(fù)數(shù)排第一個(gè)
(1)80H (2)AL, BL (3) BL
(4)DEC
54、對(duì)內(nèi)存中7個(gè)ASCII字符組成的字符串進(jìn)行如下操作,在源串前加#,后加*,再放原異或的結(jié)果....
(1)'# ' (2)00H (3)CHAR
(4)'* ' (5)0DH (6)0AH
(7)EXIT
55、無(wú)符號(hào)Ck=Ak-Bk
(1)MOV CX,N (2)SOURCE[BX+N] (3)JNC
(4)0FFH (5)[DI]
56、I*J矩陣轉(zhuǎn)置,并計(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、說(shuō)明已過(guò)峰值,記錄當(dāng)前值
(1)XOR BX,DX (2)AND BX,80H (3)Z
(4)STOSB (5)INC DI
59、ASCII,如果是0~9或A~F之間轉(zhuǎn)成二進(jìn)制
(1)MOV (2)MOV CX,N (3)'9'
(4)STRIP (5)'F' (6)INVALID
(7)NEXT
60、20個(gè)無(wú)符號(hào)數(shù),求它們的和(字型)
(1)MOV AH,0 (2)ADD BX,AX (3)AL
(4)INC SI (5)INC DI (6)BX
相關(guān)推薦:
北京 | 天津 | 上海 | 江蘇 | 山東 |
安徽 | 浙江 | 江西 | 福建 | 深圳 |
廣東 | 河北 | 湖南 | 廣西 | 河南 |
海南 | 湖北 | 四川 | 重慶 | 云南 |
貴州 | 西藏 | 新疆 | 陜西 | 山西 |
寧夏 | 甘肅 | 青海 | 遼寧 | 吉林 |
黑龍江 | 內(nèi)蒙古 |