![分支程序設(shè)計實驗報告_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/1/bf622518-87a8-4795-aa62-9804c4b1d5f0/bf622518-87a8-4795-aa62-9804c4b1d5f01.gif)
![分支程序設(shè)計實驗報告_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/1/bf622518-87a8-4795-aa62-9804c4b1d5f0/bf622518-87a8-4795-aa62-9804c4b1d5f02.gif)
![分支程序設(shè)計實驗報告_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/1/bf622518-87a8-4795-aa62-9804c4b1d5f0/bf622518-87a8-4795-aa62-9804c4b1d5f03.gif)
![分支程序設(shè)計實驗報告_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/1/bf622518-87a8-4795-aa62-9804c4b1d5f0/bf622518-87a8-4795-aa62-9804c4b1d5f04.gif)
![分支程序設(shè)計實驗報告_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/1/bf622518-87a8-4795-aa62-9804c4b1d5f0/bf622518-87a8-4795-aa62-9804c4b1d5f05.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、實驗二 分支程序設(shè)計一、實驗?zāi)康模?、學(xué)習(xí)分支程序的設(shè)計方法2、熟悉在pc機(jī)上建立、匯編、連接、調(diào)試和運(yùn)行匯編語言程序的過程二、實驗環(huán)境:硬件環(huán)境 ibm/pc 及其兼容機(jī) 軟件環(huán)境 操作系統(tǒng) dos編輯程序edit或其他編輯程序匯編程序連接程序調(diào)試程序三、實驗內(nèi)容:1、在屏幕上顯示如下信息:panda2 cat3 rabbit4 pig5 exit(please choose 1,2,3,4or 5)若輸入1顯示“ i like panda”后程序結(jié)束;若輸入2,顯示“i like cat”后程序 結(jié)束;若輸入3,顯示“ i like rabbit ”后程序結(jié)束;若輸入 4,顯示“i don
2、 tike pig”后程序結(jié)束;若輸入5,程序直接結(jié)束;若輸入其它字符,顯示“ you press an error key! ”后程序結(jié)束。1)流程圖開始選項用戶輸入yal=1ni like pandaal=2yni like catal=3yi like rabbitni like do notnnyal=5nyou press an error key結(jié)束2)源程序data segmentinfor1 db 0ah,0dh,"pa nda:$"infor2 db 0ah,0dh,"2cat:$"infor3 db 0ah,0dh,"3ra
3、bbit;$"infor4 db 0ah,0dh,"4pig:$"infor5 db 0ah,0dh,"5exit:$"infor6 db 0ah,0dh,"(please choose 1,2,3,4 or 5-):$"infor7 db 0ah,0dh,"i like pan da:$"infor8 db 0ah,0dh,"i like cat:$"infor9 db 0ah,0dh,"i like rabbit;$"infor10 db 0ah,0dh,&qu
4、ot;i like pig:$"infor11 db 0ah,0dh,"you press an error key!:$"data endscode segmentassume cs:code,ds:datastart: mov ax,datamov ds,axmov dx,offset infor1mov ah,09hint 21hmov dx,offset infor2mov ah,09hint 21hmov dx,offset infor3mov ah,09hint 21hmov dx,offset infor4mov ah,09hint 21hmov d
5、x,offset infor5mov ah,09hint 21hmov dx,offset infor6mov ah,09hint 21hmov ah,01hint 21hcmp al,'1'je pandacmp al,'2'je catcmp al,'3'je rabbitcmp al,'4'je pigcmp al,'5'je pendjmp otherpanda:mov dx,offset infor7mov ah,09hint 21hjmp pend;數(shù)據(jù)段結(jié)束;代碼段開始;段尋址;將 data 的數(shù)據(jù)存
6、入 ax 中;為 ds 賦值;返回變量 infor1 段內(nèi)偏移地址【運(yùn)行后在屏 幕上顯示字符 panda:】;執(zhí)行九號功能調(diào)用;返回變量 infor5 段內(nèi)偏移地址【運(yùn)行后在屏幕上顯示字符 5exit:】cat:mov dx,offset infor8mov ah,09hint 21hjmp pendrabbit:mov dx,offset infor9mov ah,09hint 21hjmp pendpig:mov dx,offset infor10mov ah,09hint 21hjmp pendother:mov dx,offset infor11mov ah,09hint 21hjmp
7、 pendpend:mov ah,4chint 21hcode endsend startf3,4o r5-emuhtpr screen (27x25 chars)回 ssurapanda cat : rabb i 二段乳 "ioqs e 1, bit ;毎k emulator screenchars)panda:cat 1rwbli 七;二二段比choose 1,2.3,4 or 5panda:):1clear screen£32、從鍵盤輸入一字符,判斷該字符是小寫字母、大寫字母、數(shù)字或其它字符。 若輸入為小寫字母,顯示“ you in put a lowercase l
8、ette!”;若輸入為大寫字母, 顯示 “ you in put a uppercase lette! ”;若輸入為數(shù)字,顯示 “ you input a digit!”; 若輸入為其它字符,顯示“ you in put other letter!" 01、編程指導(dǎo)數(shù)字0 9的ascii碼為30h 39h;大寫字母的ascii碼為41h 5ah,小寫 字母的ascii碼為61h 7aho本題目將字符分為小寫字母、大寫字母、數(shù)字及 其它字符,根據(jù)鍵入字符的ascii碼值判斷其所屬類型,并顯示相應(yīng)的信息。字 符串顯示使用功能號為09h的dos功能調(diào)用,接收鍵盤輸入的單個字符使用功 能號為
9、01h的dos功能調(diào)用。2、流程圖及程序框圖1) 流程圖2)源程序data segmentinf0r1 db oah,odh,"please press any key to input a letter:$"inf0r2 db 0ah,0dh,"you input a lowercase letter! $"infor3 db 0ah,0dh,"you in put a uppercase letter! $"infor4 db 0ah,0dh,"you in put a digit! $"infor5 db 0
10、ah,0dh,"you in put other letter! $"data endscode segmentassume cs:code,ds:datastart: mov ax,data;顯示信息“ please press any key to input a letter"的指令序列以及接收從鍵盤輸入一個字符的指令序列mov ds,axmov dx,offset infor1mov ah,09hint 21hmov ah,01hint 21hcmp al,'0'jbothercmpal,'9'jbedigitcmpal,&
11、#39;a'jbothercmpal,'z'jbeuppercmpal,'a'jbothercmpal,'z'jbelowerjmppendlower:mov dx,offset infor2mov ah,09hint 21hjmp pendupper:mov dx,offset infor3mov ah,09hint 21hjmp penddigit:mov dx,offset infor4mov ah,09hint 21hjmp pendother:mov dx,offset infor5mov ah,09hint 21hpend:mov ah,4chint 21hcode endsend start;顯示"you input a lowercase letter! ” 的指令序列;注意執(zhí)行完一個分支后應(yīng)使程序跳出; 顯示“ you input a uppercase letter” 的指令序列;顯示“ you input a digit! ”的指令序列;顯示“ you input other letter! ”的指令序列w emulator screen (42x5 chars)str emulator screenchars)i=l回 s3ple
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年中國全銅水槽落水頭市場調(diào)查研究報告
- 2025至2031年中國音頻電療機(jī)行業(yè)投資前景及策略咨詢研究報告
- 2025年窗配件項目可行性研究報告
- 2025至2031年中國電腦花織帶行業(yè)投資前景及策略咨詢研究報告
- 2025至2031年中國無紡紙行業(yè)投資前景及策略咨詢研究報告
- 2025年掛鎖項目可行性研究報告
- 2025年奧運(yùn)熒光筆項目可行性研究報告
- 2025至2031年中國全自動圓角切斷機(jī)行業(yè)投資前景及策略咨詢研究報告
- 2025年便攜式酒精檢測儀項目可行性研究報告
- 2025年T/C染色線卡項目可行性研究報告
- 中考物理復(fù)習(xí)備考策略
- 博士后進(jìn)站申請書博士后進(jìn)站申請書八篇
- 小報:人工智能科技科學(xué)小報手抄報電子小報word小報
- GB/T 41509-2022綠色制造干式切削工藝性能評價規(guī)范
- 全面介紹現(xiàn)貨中遠(yuǎn)期交易
- 公安系防暴安全03安檢
- 孫權(quán)勸學(xué)教案全國一等獎教學(xué)設(shè)計
- 企業(yè)生產(chǎn)現(xiàn)場6S管理知識培訓(xùn)課件
- 五年級下冊數(shù)學(xué)課件 第10課時 練習(xí)課 蘇教版(共11張PPT)
- 電梯口包邊施工方案正式
- 三年級道德與法治下冊我是獨特的
評論
0/150
提交評論