




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、華 北 科 技 學(xué) 院課程設(shè)計說明書課程名稱: 匯編語言 班級: 計算機(jī)B08-1 姓名: 胡詩招 學(xué)號: 200807014102 設(shè)計題目: 個人檔案管理文件 設(shè)計時間: 2010年6月23號 _至 2010年7月2號 _指導(dǎo)教師:_ 李冬艷_ _評 語:_評閱成績: 評閱教師: 1、 課程設(shè)計目的進(jìn)行程序設(shè)計方法和技能的基本訓(xùn)練,鞏固在課堂上學(xué)到的有關(guān)程序設(shè)計的基本知識和基本方法,通過實際動手能力的培養(yǎng),進(jìn)一步熟悉匯編語言的結(jié)構(gòu)和使用方法,達(dá)到能獨(dú)立閱讀、編制和調(diào)試一定規(guī)模的匯編語言程序的水平。2、 課程設(shè)計要求 1要求編寫并調(diào)試通過一個小型軟件,實現(xiàn)對軟件或硬件的操作。2遵循模塊化、結(jié)
2、構(gòu)化的程序設(shè)計方法。3.要求程序必須正確。4.程序簡明易懂,多運(yùn)用輸入輸出提示,出錯信息及必要的注釋。5.要求程序結(jié)構(gòu)合理,語句使用得當(dāng)。6.適當(dāng)追求編程技巧和程序運(yùn)行效率。三、課程設(shè)計題目: 個人檔案管理文件四、課題分析 程序開始時,先建立判斷是否存在文件,如果不存在,就創(chuàng)立文件。然后隨便輸入i,l,q中任意一個字母,然后跳到相應(yīng)的子程序,輸入i詩,跳到輸入的子程序,輸入相應(yīng)的數(shù)據(jù),保存到文件里。當(dāng)輸入l時,保存在文件里的數(shù)據(jù)就會顯示,每個學(xué)生的信息顯示一行。當(dāng)輸入q時,直接關(guān)閉文件,程序結(jié)束五、流程圖: 開始 先建立一個文件 輸入i,l,q中的 一個字母 輸入i 輸入l 輸入學(xué)生的名字,年
3、齡 性別,身高,體重,并把 打開文件 數(shù)據(jù)依次存到文件 顯示學(xué)生名字,年領(lǐng) ,性別,身高,體重 輸入q 關(guān)閉文件 結(jié)束六、程序源代碼:vardata segment filename db 'ffff.txt',00 ;定義文件vardata endscondata segment names db 10 dup(?) ;名字定義 age db ?,? ;年齡定義 sex db 2 dup(?) ;性別定義 height db 3 dup(?) ;身高定義 weight db 3 dup(?) ;體重定義 mess_n db 0dh,0ah,' name:$'
4、mess_a db 0dh,0ah,' age:$' mess_s db 0dh,0ah,' sex:$' mess_h db 0dh,0ah,' height:$' mess_w db 0dh,0ah,' weight:$' s4 db 0dh,0ah db '*',0dh,0ah db '* -1: print list L- *',0dh,0ah db '* -2: insert new ele I- *',0dh,0ah db '* -3: quit q- *'
5、;,0dh,0ah db '*',0dh,0ah db 0dh,0ah db '$' s1 db ' name age sex height weight',13,10,'$' s2 db ' $' s3 db ' $'condata endscode segment assume cs:code,ds:vardata,es:condatastart: mov ax, condata mov es, ax mov ax, vardata mov ds, ax push ds;-print comma
6、nd hint- mov ax, es mov ds, ax mov dx, offset s4 mov ah, 9h int 21h pop ds;-intepret command-cmp_l: mov ah, 01h int 21h cmp al, 'l' jnz cmp_i call list_all jmp startcmp_i: cmp al, 'i' jnz cmp_q call insert jmp startcmp_q: cmp al, 'q' jnz closef exit: mov ax, 4c00h int 21h;-打開
7、和創(chuàng)建文件list_all proc near call open_create ;open or create file push ds mov ax, es ;es里放的是文件 mov ds, ax lea dx, s1 mov ah, 9 int 21h mov dl, 0ah mov ah,2 int 21hloop_rd: mov ah, 3fh ;read record from file to memory 讀取文件 mov dx, offset names mov cx, 20 mov bx, si int 21h cmp ax, 0 je read_finish ;read
8、to the end,then finish相等是結(jié)束 ;-名字 lea dx, s3 mov ah, 9 int 21h mov bx, 0go_on: mov dl, namesbx mov ah, 2h int 21h inc bx cmp bx, 10 jl go_on;-年齡 lea dx,s2 mov ah,9 int 21h mov dl, age0 mov ah, 2 int 21h mov dl, age1 mov ah, 2 int 21h;-性別 lea dx,s2 mov ah,9 int 21h mov bx, 0l1: mov dl, sexbx mov ah, 2
9、h int 21h inc bx cmp bx, 2 jl l1;-身高 lea dx,s2 mov ah,9 int 21h mov bx, 0l2: mov dl, heightbx mov ah, 2h int 21h inc bx cmp bx, 3 jl l2;-體重 lea dx,s2 mov ah,9 int 21h mov bx, 0l3: mov dl, weightbx mov ah, 2h int 21h inc bx cmp bx, 3 jl l3 mov dl, 0dh mov ah,2 int 21h mov dl, 0ah mov ah,2 int 21h jmp
10、 loop_rd ; a record finished ,then to read the next接著顯示read_finish: call closef pop ds retlist_all endp;-輸入子程序insert proc near call open_create ; open of create file push ds mov ax, es mov ds, ax;-名字輸入 mov dx, offset mess_n mov ah, 9h int 21h mov bx, 0init: ;memory initialize初始化 mov namesbx,0 inc bx
11、 cmp bx, 20 jl init mov bx, 0lp: ;從鍵盤接受數(shù)據(jù) mov ah, 1 int 21h cmp al, 0dh jz inext cmp al, 0ah jz inext mov namesbx,al inc bx cmp bx, 10 jl lp ;-年齡 的輸入inext: lea dx,s2 mov ah,9 int 21h mov dx, offset mess_a mov ah, 9h int 21h mov bx, 0lp2: mov ah, 1h int 21h cmp al, 0dh jz inext1 cmp al, 0ah jz inext1
12、 mov agebx,al inc bx cmp bx, 1 jle lp2 ;-性別輸入 inext1: lea dx,s2 mov ah,9 int 21h mov dx, offset mess_s mov ah, 9h int 21h mov bx, 0 lp3: mov ah, 1h int 21h cmp al, 0dh jz inext2 cmp al, 0ah jz inext2 mov sexbx,al inc bx cmp bx,2 jle lp3 ;-身高輸入inext2: lea dx,s2 mov ah,9 int 21h mov dx, offset mess_h
13、mov ah, 9h int 21h mov bx, 0lp4: mov ah, 1h int 21h cmp al, 0dh jz inext3 cmp al, 0ah jz inext3 mov heightbx,al inc bx cmp bx,3 jle lp4 ;-體重輸入inext3: lea dx,s2 mov ah,9 int 21h mov dx, offset mess_w mov ah, 9h int 21h mov bx, 0lp5: mov ah, 1h int 21h cmp al, 0dh jz iexit cmp al, 0ah jz iexit mov wei
14、ghtbx,al inc bx cmp bx,3 jle lp5 iexit: ;move the file pointer to the end of file mov ah, 42h ;移動文件 mov al, 2 mov bx, si mov cx, 0 mov dx, 0 int 21h mov ah, 40h ;write the record to file寫入文件 mov bx, si mov cx, 20 mov dx, offset names int 21hback: call closef pop ds retinsert endp;-open_create proc n
15、ear push ds mov ax, seg filename ;filename文件d的段地址值送給ax mov ds, ax mov ah, 3dh ;open the file mov dx, offset filename mov al, 2h ;顯示文件 int 21h jnc ok ;大于等于時跳轉(zhuǎn) mov ah, 3ch ;如果不存在文件,就創(chuàng)建文件 mov dx, offset filename mov cx, 00 int 21hok: mov si, ax pop ds retopen_create endpclosef proc near mov bx, si mov ah, 3eh ;關(guān)閉文件 int 21h retclosef endp code ends end start七、結(jié)果顯示8、 感想、收獲及體會 課程設(shè)計從開始找資料到課設(shè)結(jié)束,在這短時間里,課設(shè)給我的收獲很大,雖然我的題目不是很難,比其他同學(xué)
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 奉賢區(qū)羽毛球球場施工方案
- 水庫牧道及庫區(qū)清施工方案
- 長沙設(shè)備內(nèi)襯防腐施工方案
- 2025年中國搬運(yùn)機(jī)器人產(chǎn)業(yè)深度分析、投資前景及發(fā)展趨勢預(yù)測報告
- 生態(tài)補(bǔ)償機(jī)制的建設(shè)與完善策略及實施路徑
- 中西通俗小說賞析知到課后答案智慧樹章節(jié)測試答案2025年春溫州理工學(xué)院
- 2025年電子金融相關(guān)設(shè)備項目建議書
- 數(shù)學(xué)高考備考講義第三章不等式35
- 燈條施工方案模板
- 2025年高三二輪專題復(fù)習(xí)學(xué)案地理(藝體生專用)第26講地區(qū)產(chǎn)業(yè)結(jié)構(gòu)變化與產(chǎn)業(yè)轉(zhuǎn)移
- 中考百日誓師大會-百日沖刺決戰(zhàn)中考-2024年中考百日誓師大會(課件)
- 非線粒體氧化體系講解課件
- 初中八年級語文課件-桃花源記 全國公開課一等獎
- 《無人機(jī)操控技術(shù)》教案全套 1.1 無人機(jī)概述 -6.2 自動機(jī)場操控
- ISO27001標(biāo)準(zhǔn)培訓(xùn)課件
- 《審核員培訓(xùn)教程》課件
- 《光催化技術(shù)》課件
- 辦公打印機(jī)的租賃合同范文
- 危大工程監(jiān)理巡視檢查用表
- 大埔縣生活垃圾填埋場應(yīng)急加固及滲濾液處理站擴(kuò)容改造工程環(huán)境影響報告
- 餐飲行業(yè)儀容儀表標(biāo)準(zhǔn)規(guī)范
評論
0/150
提交評論