freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

微機(jī)原理及應(yīng)用習(xí)題答案(共五則范文)-文庫吧

2024-11-09 22:01 本頁面


【正文】 mov ds,axmov ax,buffx cmp ax,0 jbe change mov signx,0 jmp done change: mov signx,1 done: mov ax,4c00h int 21h code ends end start 3.20 bufX、bufY和bufZ是3個有符號十六進(jìn)制數(shù),編寫一個比較相等關(guān)系的程序:(1)如果這3個數(shù)都不相等,則顯示0。(2)如果這3個數(shù)中有兩個數(shù)相等,則顯示1。(3)如果這3個數(shù)都相等,則顯示2。答:data segment bufxdb bufydb bufzdb data endsstack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ds:data, ss:stackstart: mov ax,data mov ds,axmov al,bufx mov bl,bufy mov cl,bufzcmp al,bl jecac cmp al,cl jeview1 cmp bl,cl jeview1 mov dl,39。039。 jmp view 1333cac: cmp al,cl jeview2 view1: mov dl,39。139。 jmp view view2: mov dl,39。239。view: mov ah,02h int 21hmov ax,4c00h int 21h code ends end start 3.,如果要實(shí)現(xiàn)所有為1的位都順序執(zhí)行相應(yīng)的處理程序段(而不是例題中僅執(zhí)行最低為1位的處理程序段),請寫出修改后的代碼段? 答:data segment number db 78h addrs dw offset fun0, offset fun1, offset fun2, offset fun3,offset fun4, offset fun5, offset fun6, offset fun7 data endsstack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ds:data, ss:stack start: mov ax, data mov ds, axmov dh, number mov cx, 8 mov bx, 0 lp1: shr dh, 1 jcnextagain: inc bx inc bx loop lp1 jmp done next: jmp addrs[bx]fun0: mov dl, 39。039。 jmp view fun1: mov dl, 39。139。 jmp view fun2: mov dl, 39。239。 jmp view fun3: mov dl, 39。339。 jmp view fun4: mov dl, 39。439。 jmp view fun5: mov dl, 39。539。 jmp view fun6: mov dl, 39。639。 jmp view fun7: mov dl, 39。739。 jmp viewview: mov ah, 02h int 21h jmp againdone: mov ax, 4c00h int 21hcode ends end start 3.22編制程序完成12H, 45H, F3H, 6AH, 20H, FEH, 90H, C8H, 57H和34H共10個無符號字節(jié)數(shù)據(jù)之和,并將結(jié)果存入字節(jié)變量SUM中(不考慮進(jìn)位)。答:data segment num db 12h, 45h, 0f3h, 6ah, 20h, 0feh, 90h, 0c8h, 57h, 34h sum db ? data endsstack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ds:data, ss:stack start: mov ax, data mov ds, axmov cx, 10 lea bx, numagain: mov al, [bx] add sum, al inc bx loop againmov ax, 4c00h int 21h code ends end start 3.23 求主存0040H:0開始的一個64KB物理段中共有多少個空格? 答:stack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ss:stack start: mov ax, 0040h mov es, ax mov di, 0 mov cx, 0 mov bx, 0 mov al, 39。 39。 again: scasb jne next inc bx next: dec cx jne againmov ax, 4c00h int 21h code ends end start 3.24編寫計(jì)算100個正整數(shù)之和的程序。如果和不超過16位字的范圍(65535),則保存其和到wordsum,如超過則顯示 ?overflow!?。答:data segment num dw 100 dup(800)sum dw ? msg db 39。Overflow!39。, 13, 10, 39。$39。 data endsstack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ds:data, ss:stack start: mov ax, data mov ds, axmov cx, 100 lea bx, num mov ax, 0again: add ax, [bx] inc bx inc bx jcerr loop againmov sum, ax jmp done err: mov dx, offset msg mov ah, 09h int 21hdone: mov ax, 4c00h int 21h code ends end start 3.25編制程序完成將一個16位無符號二進(jìn)制數(shù)轉(zhuǎn)換成為用8421BCD碼表示的5位十進(jìn)制數(shù)。轉(zhuǎn)換算法可以是:用二進(jìn)制數(shù)除以10000,商為“萬位”,再用余數(shù)除以1000,得到“千位”;一次用余數(shù)除以100、10和1,得到“百位”、“十位”和“個位”。答:data segment bnum dw 19982 dnum db 5 dup(?), 39。$39。 data endsstack segment stackdb 100 dup(?)stack endscode segment 39。code39。 assume cs:code, ds:data, ss:stackstart: mov ax, data mov ds, axmov ax, bnum lea bx, dnum mov dl, 0 cwd mov cx, 10000 div cx add al, 30h mov [bx], al inc bx mov ax, dxcwd mov cx, 1000 div cx add al, 30h mov [bx], al inc bx mov ax, dx cwd mov cx, 100 div cx add al, 30h mov [bx], al inc bx mov ax, dx cwd mov cx, 10 div cx add al, 30h mov [bx], al inc bxadd dl, 30h mov [bx], dlmov dx, offset dnum mov ah, 09h int 21hmov ax, 4c00h int 21hcode ends endstart 3.27編寫一個源程序,在鍵盤上按一個鍵,將從AL返回的ASCII碼值顯示出來,如果按下ESC鍵則程序退出。答:stack segment stackdb 100h dup(?)stack endscodesegmentstart: mov ah, 07h int 21hcmp al, 1bh jedonepush ax mov dl, al mov cl, 4 shr dl, cl call htoasc mov ah, 02h int 21hpop ax mov dl, al and dl, 0fh call htoasc mov ah, 02h int 21hjmp startdone: mov ax, 4c00h int 21h htoasc proc add dl, 30h cmp dl, 39h jbe htoend add dl, 7 htoend: ret htoasc endp 39。code39。 assume cs:code, ss:stackcodeends endstart 3.28請按如下說明編寫子程序:;子程序功能:把用ASCII碼表示的兩位十進(jìn)制數(shù)轉(zhuǎn)換位對應(yīng)二進(jìn)制數(shù) ;入口參數(shù):DH=十位數(shù)的ASCII碼,DL=個位數(shù)的ASCII碼 ;出口參數(shù):AL=對應(yīng)的二進(jìn)制數(shù) 答:stack segment stack endscodesegment 39。code39。 assume cs:code, ss:stack start: mov dx, 3932h call asctohmov ax, 4c00h int 21hasctoh proc push cx sub dx, 3030h mov cl, 10 mov al, dh mul cl add al, dl pop cx ret asctoh endp stackdb 100h dup(?)codeends endstart 3.29調(diào)用HTOASC子程序,編寫顯示一個字節(jié)的16進(jìn)制數(shù)、后跟“H”的子程序。答:stack segment stackdb 100h dup(?)stack endscodesegment 39。code39。 assume cs:code, ss:stackstart: mov ah, 07h int 21hcmp al, 1bh jedone call htoahjmp startdone: mov ax, 4c00h int 21hhtoah proc push ax push cx push dx push ax mov dl, al mov cl, 4 shr dl, cl call htoasc mov ah, 02h int 21hpop ax mov dl, al and dl, 0fh call htoasc mov ah, 02h int 21hmov dl, 39。H39。 mov ah, 02h int 21h pop dx pop cx pop ax ret htoah endphtoasc proc add dl, 30h cmp dl, 39h jbe htoend add dl, 7 htoend: ret htoasccodeends endstart 3.30寫一個子程序,根據(jù)入口參數(shù)AL=0、2,依次實(shí)現(xiàn)對大些字母轉(zhuǎn)換成小寫、小寫轉(zhuǎn)換成大寫或大小寫字母互換。欲轉(zhuǎn)換的字符串在string中,用0表示結(jié)束。答:data segment string db 39。abcDEfGh39。, 39。$39。 data endsstack segment stackdb 100 dup(?)stack endscodesegment 39。code39。 assume cs:code, ds:data, ss:stack start: mov ax, data mov ds, axmov al, 2 call changemov dx, offset string mov ah, 09h int 21hmov al, 0 call changemov dx, offset string mov ah, 09h int 21hmov al, 1 call changemov dx, offset string endp mov ah, 09h int 21hmov ax, 4c00h int 21hchange proc lea bx, string cmp al, 0 jecg1 cmp al, 1 jecg2 cg3: cmp byte ptr [bx], 39。$39。 jedone cmp byte ptr [bx], 5ah jaxtod add byte ptr [bx], 20h jmp cg33 xtod: sub byte ptr [bx], 20h cg33: inc bx jmp cg3 cg2: cmp byte ptr [bx], 39。$39。 jedone cmp byte ptr [bx], 61h jbcg22 sub byte ptr [bx], 20h cg22: inc bx jmp cg2 cg1: cmp byte ptr [bx], 39。$39。 jedone cmp byte ptr [bx], 5ah jacg11 add byte ptr [bx], 20h cg11: inc bx jmp cg1done: ret change endpcodeends endstart 3.34編寫一個計(jì)算字節(jié)校驗(yàn)和的子程序。所謂“校驗(yàn)和”是指不記進(jìn)位的累加,常用于檢查信息的正確性。主程序提供入口參數(shù),有數(shù)據(jù)個數(shù)和數(shù)據(jù)緩沖區(qū)的首地址。子程序回送求和結(jié)果這個出口參數(shù)。傳遞參數(shù)方法自定
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1