




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
浙江大学20042005学年_夏_季学期汇编程序设计课程期末考试试卷开课学院: 计算机学院 ,考试形式:开卷,允许带 书本 入场考试时间:2005年 7 月 4 日,所需时间: 120 分钟,任课教师_ 考生姓名: _学号: 专业: _ 题序一二三四五六七八九十总 分得分评卷人1. Some of the following instructions are incorrect, please mark for those correct instructions, and mark for those incorrect instructions. (61 points)( ) (1). DIV DX,AXANSWER: (F)( ) (2). OUT DX,AHANSWER: (F)( ) (3). JMP CHANSWER: (F)( ) (4). SUB IP,2000HANSWER: (F)( ) (5). SAR EDI, 8ANSWER: (T)( ) (6). REPE ADD AX, DIANSWER: (F)2. Please select your best choices for the following questions. (62 points)() Which of the following instructions will not change the content of AL?(A). XOR AL, 3AH(B). TEST AL, 80H(C). MUL CL (D). AND AL,55HANSWER: (B)() Which instruction is equivalent to “MOV EBX, OFFSET DATA2”?(A). LES EBX, DATA2(B). LEA EBX, DATA2(C). LDS EBX, DATA2 (D). MOV EBX, DATA2ANSWER: (B)() According to the following memory data, the entry address of INT 21H should be .0000:0070 AD 06 14 02 A4 F0 00 F0-37 05 14 02 11 6D 00 C00000:0080 72 10 A7 00 7C 10 A7 00-4F 03 80 05 8A 03 80 05(A). 00A7:107C(B). 7C10:A700(C). A700:1072 (D). 7210:A700ANSWER: (A)() Which of the following instructions moves a word located by DS:SI to the memory unit located by ES:DI?(A). LEA DI, SI (B). MOV ES:DI, WORD PTRSI (C). MOVSW (D). LES DI,SI ANSWER: C() Instruction implements ESI - EBX+2*EAX?(A). ADD ESI, EBX+2*EAX (B). LEA ESI, EBX+2*EAX (C). MOV ESI, EBX+2*EAX(D). ADD ESI, EBX+2*EAX ANSWER: B() MOV AX, 1FFHMOV CX, 30FEHIMUL CL, then AX= (A). 64770 (B). 0FFFEH (C). 2 (D). 4 ANSWER: C3. Please fill in the following blanks. (62 points)() XOR CX, CXDEC CXCMP CX, 0FFFFHthen CF= , ZF= .ANSWER: CF= 0 , ZF= 1 p118 in muhanmud CHECK() XOR DX, DXCMP DX, 0FFFFHthen DX= .ANSWER: DX= 0 .() Following instructions configure the 8088 PC as follows: prohibit interrupts to happen; save the lower byte of the flag register to memory at physical address 000C0H; and then clear CF; MOV AX, 0 MOV BX, 00C0HLAHF CLCANSWER: CLIMOV DS, AXMOV BX, AH4. Some registers and memory contents of 8086 PC are as follows: CS=1075, IP=0300, BX=0100, SI=0100, (DS:100)=00H, (DS:101)=10H, (DS:200)=00H, (DS:201)=01H, (DS:202)=00H, (DS:203)=10H. After executing each instruction listed below, what will be the new CS:IP ? (3 points)(a) CALL 1000H, new CS:IP= . (b) CALL WORD PTR 100H, new CS:IP= (c) CALL DWORD PTR BX+SI, new CS:IP= ANSWER:(A) 1075:1000H(B) 1075:1000(C) 1000:0100P294-28 TRIEB5. Please use string instructions to write equivalent instruction sequences for each of the following: (6 points)(A) . MOV AL, SI ; MOV DI, AL ; INC SI ; INC DI (B) . MOV AX, SI; INC SI; INC SI(C) . MOV AL, DI; CMP AL, SI; DEC SI;DEC DIANSWER: P295-43 TRIEB(A) CLD; PUSH DS; POP ES; MOVSB(B) CLD; LODSW(C) STD; PUSH DS; POP ES; CMPSB 6. Following program is developed under 32-bit Visual C+ environment, function ShowN(int dn) displays dn in digital number form. Library function putch(temp) is used to display an ASCII character, and its parameter temp provides the characters ASCII code. Please fill assembly instruction into each blank to implement above function. (12 points)void ShowN(int dn) /dn is a 32-bit integer int temp, ten=10; / type int is 32-bit integer_asm xor ecx, ecx_asm mov eax, dnxor ecx, ecxstep1:mov edx,0div tenpush edxinc ecxcmp eax, 0jnz step1step2: pop tempadd temp,30hpush ecxputch(temp);_asm pop ecxloop step2step1: div tenpush edx cmp eax, 0 step2: pop temp push ecxputch(temp);_asm loop step27. The content of a Pentium 4 descriptor is: 0AH, C0H, B1H, 3BH, 40H, 5CH,00H, 1FH, here the first byte 0AH is the most significant byte (B31-B24 of base address ). According to these content of descriptor, (10 points)l the base address of the memory segment is ;l the size of the memory segment is bytes; l the access right byte of the memory segment is ;l the DPL of the memory segment is ;l the instruction mode of the memory segment is (16-bit or 32-bit );ANSWER:l the base address of the memory segment is 0A3B405CH ;l the size of the memory segment is 20000H bytes; l the access right byte of the memory segment is B1H ;l the DPL of the memory segment is 01B ;l the instruction mode of the memory segment is 32-bit (16-bit or 32-bit );0AH,11000000,10110001,3B,40,5C,00,1F 8. (15 points)A GPS device provides 8-bit data to PC via 82C55s port B which works in mode 1. Pin /STB of the GPS provides a strobe signal to 82C55s pin PC2, pin /NOTIFY of the GPS also requires 82C55s PC6 to send a negative pulse after 82C55 has received the data. Suppose that port A,B,C and command port of 82C55 use addresses 50H,51H,52H,53H respectively. (1) Please draw a diagram showing the connection of 82C55 and GPS. (3 points)(2) Please fill instruction or operand in following blanks to implement above function. (12 points)Wait1: TEST AL, IN AL, 51HMOV AL, OUT 53H, AL ; output 0 in PC6MOV AL, ; output 1 in PC6ANSWER:Wait1:IN AL, 52HTEST AL, 1 JZ WAIT1IN AL, 51HMOV AL, 00001100BOUT 53H, AL ; MOV AL, 00001101BOUT 53H, AL;9. Suppose that 16550 is receiving ASCII characters from peripheral device and its port addresses are C0HC8H. Procedure RECV receives a character and display it on screen. If 16550 detects a receiving error, CPU fetches the erroneous character and then displays a ?. Please fill in the blanks to implement above function. (12 points)DATA EQU 0C0HLSTATEEQU 0C5HRECV PROC FARWAITR:IN AL, LSTATE TEST AL, 1 JNZ ERR CALL DISPRETERR:IN AL, DATA RETRECV ENDPDISPPROC NEARMOV AH, 06H INT 21HDISP ENDPANSWER:RECV PROC FARWAITR:IN AL, LSTATETEST ALJZ WAITRTEST AL, 00001110BJNZ ERRIN AL, DATACALL DISPRETERR:IN AL, DATAMOV AL, ?CALL DISPRETRECV ENDPDISPPROC NEARMOV AH, 06HMOV DL, ALINT 21HDISP ENDP10. (12 points)In an interrupt system of X86 computer based on 8259A, chip A acts as main 8259A, while chip B1,B2 and B3 act as slave 8259As. Chip As pin IR0,IR2 and IR4 connect to pin INT of B1,B2 and B3. Main chip As I/O port addresses are 30H-31H, its interrupt vector numbers are 10-17H; All 8259As adopt not SNFM, not buffered, level triggered, normal EOI mode, and use ICW4. (Please use binary numbers to interpret ICW1ICW4.) (1) As ICW1,ICW2,ICW3,ICW4. (4 points)(2) Chip As IR1 connects to a clock input which generates 20 ticks per second, a 4-byte
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年互联网+日化洗涤行业研究报告及未来发展趋势预测
- 商场国庆节前安全培训课件
- 商场商家安全用电培训课件
- 2025年控制系统行业控制系统数字化应用前景报告
- 2025年清洁能源行业风能发电技术前景研究报告
- 岱山县2025浙江舟山市岱山县事业单位紧缺专业人才招聘14人笔试历年参考题库附带答案详解
- 压力容器安全标准培训课件
- 安徽省2025年安徽省自然资源厅直属事业单位招聘9人笔试历年参考题库附带答案详解
- 大洼区2025年辽宁盘锦市大洼区招聘事业单位工作人员笔试考试笔试历年参考题库附带答案详解
- 介休市2025山西晋中介休市事业单位招聘133人笔试历年参考题库附带答案详解
- 《传统书画装裱与修复中材料的选择与运用》
- 2024ESC心房颤动管理指南解读
- 防洪排涝工程合同范本有效
- 高血压病基层诊疗指南
- 医院视频监控系统维保方案
- 门诊护士课件教学课件
- 《大学生的人际关系》课件
- 职务侵占罪培训
- 中式烹调师技能等级认定四级理论知识试卷
- DB65-T 4784-2024 冰川范围调查技术规范
- 幼儿园礼仪小天使《借物品》教学课件
评论
0/150
提交评论