已阅读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重庆水务环境控股集团管网有限公司招聘20人笔试考试参考试题及答案解析
- 七年级上册语文期中常考作文押题+范文
- 膏药的营销方案
- 广东省佛山市三水区2024-2025学年七年级上学期语文期末考试试卷(含答案)
- 2025年古玩艺术品委托拍卖协议
- 2025课堂惩罚 主题班会:马达加斯加企鹅课堂惩罚 课件
- 2025医师定期考核题库中医真题及答案
- 2025年郑州巩义市金桥融资担保有限公司公开招聘3名考试笔试参考题库附答案解析
- 2025甘肃庆阳市林业和草原局招聘专职聘用制护林员92人笔试考试备考题库及答案解析
- 2026年1月云南省普通高中学业水平合格性考试语文仿真模拟卷01(春季高考适用)(考试版)
- ERP系统运行使用管理办法
评论
0/150
提交评论