計(jì)算機(jī)等級(jí)考試三級(jí)PC技術(shù)上機(jī)14_第1頁
計(jì)算機(jī)等級(jí)考試三級(jí)PC技術(shù)上機(jī)14_第2頁
計(jì)算機(jī)等級(jí)考試三級(jí)PC技術(shù)上機(jī)14_第3頁
計(jì)算機(jī)等級(jí)考試三級(jí)PC技術(shù)上機(jī)14_第4頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、2013年計(jì)算機(jī)等級(jí)考試三級(jí)pc技術(shù)上機(jī)(14)請(qǐng)編制程序,其功能是:對(duì)一個(gè)由可打印ascii字符(ascii碼20h7fh)組成的字符串可采用下列方法進(jìn)行壓縮:從串首開始向后掃描,如某字符單獨(dú)出現(xiàn)該字符不變,如某字符連續(xù)出現(xiàn)n次,則該字符用esc(1bh),n,三個(gè)字節(jié)來代替(假定n不超過255)。例如:原串: 41h,43h,43h,43h,43h,43h,43h,61h,00h(acccccca)壓縮后: 41h,1bh,06h,43h,61h,00h設(shè)內(nèi)存中從source開始有一字符串,其以00h結(jié)束,長(zhǎng)度不超過100。試編程對(duì)其進(jìn)行壓縮,結(jié)果存入result開始的內(nèi)存單元。部分程序已

2、給出, 其中原始數(shù)據(jù)由過程load從文件input1.dat中讀入source開始的內(nèi)存單元中。運(yùn)算結(jié)果要求從result開始存放,由過程save保存到文件output1.dat中。填空begin和end之間已給出的一段源程序使其完整(空白已用橫線標(biāo)出,每行空白一般只需一條指令, 但采用功能相當(dāng)?shù)亩鄺l指令亦可),或刪除begin和end之間原有的代碼并自行編程來完成要求的功能。對(duì)程序必須進(jìn)行匯編,并與io.obj鏈接產(chǎn)生prog1.exe執(zhí)行文件,最終運(yùn)行程序產(chǎn)生結(jié)果(無結(jié)果或結(jié)果不正確者均不得分)。調(diào)試中若發(fā)現(xiàn)整個(gè)程序中存在錯(cuò)誤之處, 請(qǐng)加以修改。試題程序:extrn load:far,sa

3、ve:farn equ 100esc_code equ 27stac segment stackdb 128 dup(?)stac endsdata segmentsource db n dup(?)result db n dup(0)name0 db input1.dat,0name1 db output1.dat,0data endscode segmentassume cs:code,ds:data,ss:stacstart proc farpush dsxor ax,axpush axmov ax,datamov ds,axmov es,ax ;置附加段寄存器lea dx,source

4、 ;數(shù)據(jù)區(qū)起始地址lea si,name0 ;原始數(shù)據(jù)文件名mov cx,n ;字節(jié)數(shù)call load ;從input1.dat中讀取數(shù)據(jù);*begin*lea si,sourcelea di,resultcldinc dil0: _cmp al,0je quitmov cx,offffh ;set the counter to 0ffffh_ ;字符串重復(fù)搜索,cx=0ffffh-nneg cx ;10000h-cxcx_ ;獲得重復(fù)次數(shù)ncmp cx,1j_ compressmov si,alinc sijmp _compress:mov si,byte ptr esc_codemov

5、si+1,clmov si+2,al_jmp l0quit: mov si,al ;store the 00h;*end*lea dx,result ;結(jié)果數(shù)據(jù)區(qū)首址lea si,name1 ;結(jié)果文件名mov cx,n ;字節(jié)數(shù)call save ;保存結(jié)果到文件retstart endpcode endsend startc29c91afe4ced1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afedd1b6c87d1b6c8795ad9c91afe4ced1b6c8795ad91afe

6、4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af95ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9d1b6c8795ad9c91afe4ced1b6c8795a1afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afc91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6cd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6

7、c8795ad29c91af8795ad9c91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c87d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af5d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afad9c91fe4ced1b6c8795ad29c91afb6c8795ad29c91afb6c8795ad29c91afd1b6

8、c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91affe4ced1b6c8795ad29c91afc8795ad9c91fe4ced1b6c8795ad29c91afd1b6c8795ad9c91afed1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8d1b6c8

9、795ad9c91afe4ced1d91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afc91fe4ced1d1b6c871afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afc91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6cd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af8795ad9c91fe4ced1d1b6c

10、8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c87d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af5d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afad9c91fe4ced1b6c8795ad29c91afb6c8795ad29c91afb6c8795ad29c91afd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ce

11、d1b6d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8791afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afc91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6cd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af8795ad9c91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91

12、afe4ced1b6c87d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af5d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afad9c91fe4ced1b6c8795ad29c91afb6c8795ad29c91afb6c8795ad29c91afd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6d1b6c8795ad9c91afe4ced1b6

13、c8795ad91afe4ced1b6c8795ad9c91d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91affe4ced1b6c8795ad29c91afc8795ad9c91fe4ced1b6c8795ad29c91afd1b6c8795ad9c91afed1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8d1b6c8795ad9c91afe4ced15ad9c91d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced

14、1b6c8795ad9c91fe4ced1b6c8795ad29c91affe4ced1b6c8795ad29c91afc8795ad9c91fe4ced1b6c8795ad29c91afd1b6c8795ad9c91afed1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8d1b6c8795ad9c91afe4ced195ad9c91afe4ced1b6c8795ad91afe4ced1b6cd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af879

15、5ad9c91fe4ced1d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c87d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af5d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afad9c91fe4ced1b6c8795ad29c91afb6c8795ad29c91afb6c8795ad29c91afd1b6c8795ad9c91afe4ce

16、d1b6c8795ad91afe4ced1b6d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91affe4ced1b6c8795ad29c91afc8795ad9c91fe4ced1b6c8795ad29c91afd1b6c8795ad9c91afed1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8d1b6c8795ad9c91afe4ced1

17、b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af795ad9c91fe4ced1b6c8795add1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af29c91af4ced1b6c8795ad1b6c8795ad9c91afe4ced1b6c8795ad91afd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad9c91afe4ced1b6c

18、8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afd1b6c8795ad29c91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91afd91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c9d1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad29c91af1afd1b6c8795ad9c91afe4ced1b6c8795ad91afe4ced1b6c8795ad9c91fe4ced1b6c8795ad2

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論