Download 組合語言期中測驗考卷

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
學號:
組合語言期中測驗考卷
班級:
一、選擇題:30%
1. A program that combines object files into an executable program
is called a _________. (1) compiler (2) loader (3) linker (4)
assembler.
姓名:
12. Which of the following are true about the PUSH instruction?
(1) It decrements the stack pointer (by 2 or 4) and copies the
operand into the stack at the location pointed to by the stack
pointer.
2. Which of the following best describes the relationship between
assembly language and machine language? (1) one to many (2)
one to one (3) many to one (4) many to many
(2) It copies the operand into the stack at the location pointed to by
the stack pointer, and then decrements the stack pointer (by 2 or
4).
3. Conventional machine language instructions are executed by
which virtual machine level? (1) microarchitecture level (2) ISA
level (3) assembly language level
(3) It increments the stack pointer (by 2 or 4) and copies the
operand into the stack at the location pointed to by the stack
pointer.
4. Which two 32-bit registers are known as extended index
registers? (1) SI, DI (2) EAX, EBX (3) ESI, EDI (4) EBP, ESP
(4) It increments the stack pointer by 1 and copies the operand into
the stack at the location pointed to by the stack pointer.
5. How much memory can be addressed in Real-address mode? (1)
640 K (2) 1 MB (3) 16 MB (4) 4 GB
13. Which of the following instructions will divide the unsigned
integer in EBX by 8? (1) shr ebx,8 (2) shr ebx,3 (3) sar ebx,8 (4)
shl ebx,3
6. Which of the following linear addresses matches the
segment-offset address 08F0:0200? (1) 09100h (2) 09200h (3)
0AF0h (4) 08F2h
14.Which of the following instructions will multiply the integer in
EBX by 32? (1) shr ebx,5 (2) rol ebx,32 (3) shl ebx,5 (4) ror
ebx,32
7. How is Virtual-8086 mode similar to Real-address mode? (1)
15. What will be the hexadecimal values of DX and AX after the
following instructions have executed?
mov ax,6B49h
permits the use of virtual memory (paging) (2) uses a segment
descriptor table to track memory usage (3) uses only 16-bit
registers for input-output (4) simulates 8086-based computer
running in Real-address mode.
8. If you wanted to find out whether an integer contained an even
number of 1 bits, which status flag would be useful? (1) carry (2)
overflow (3) sign (4) parity
9. In regard to multitasking, a task's state consists of which three
elements? (1) status flags, program counter, register contents (2)
register contents, task variables, program counter (3) task
variables, segment descriptor, register contents (4) segment
descriptor, status flags, task variables
10. In a 6-stage dual-pipelined processor, how many clock cycles
are required to execute 5 instructions? (Assume that stage 4
requires two clock cycles, and that stage 4 has two pipelines.) (1)
10 (2) 11 (3) 12 (4) 15
11. What is the final value of AX after this code has executed?
mov edx,OFFSET word1+8
mov ecx,2
mov ax,0
L1:
mov ax,[edx]
add ax,20h
sub edx,4
Loop L1
(1) 8040h (2) 9040h (3) 4020h (4) 3020h
mov dx,0095h
shl ax,1
rcl dx,1
(1) DX = 0148h, AX = C691h (2) DX = 012Ah, AX = C9A2h
(3) DX = 012Ah, AX = D692h (4) DX = 024Bh, AX = D692h
二、填充題:30%
1. The technique of executing instructions in parallel is called
________.
2. In the Flat segmentation model, which table holds the addresses
of segments? ________
3.A command that is recognized and executed by the assembler
while the source code is being assembled is a(n) __________.4.
Which directive enables block-style comments?
__________.5.Given the following array definition, write a
constant declaration named ArraySize that automatically
calculates the size in bytes, of the array: newArray DWORD
10,20,30,40,50 _________________
6. Use the following data definitions until notified otherwise:
byte1
BYTE 0FFh,1,2
byte2 BYTE 14h
word1 WORD 0FFFFh,1,2
word2 WORD 3
word3 SWORD 7FFFh,8000h
word4 SWORD 9000h
dword1 DWORD 10h,20h,30h,40h
dArray DWORD 10 DUP(?)
(1) Write an instruction that moves the 32-bit address of word1
into the ESI register (assume 32-bit Protected mode).
_________________
(2) Write an instruction that moves the lower 16 bits of dword1
into the BX register. _________________
7. What is the final hexadecimal value of AX when this code
executes?
mov esi,OFFSET word1
add esi,4
mov ax,[esi]
AX=_________________
8. Write code that causes a 500 millisecond delay, using a library
procedure.
_________________
9. Write a statement that moves a video color constant to EAX. The
constant should represent black text on a white background,
using the constants described in the Irvine32.inc file.
_________________
10. In the following instruction sequence, show the values of the
Carry, Zero, and Sign flags where indicated:
mov al,00110011b
test al,2;(1)(CF,ZF,SF)=_____________
mov al,6
cmp al,5;(2)(CF, ZF,SF)= _____________
mov al,5
cmp al,7;(3)(CF,ZF,SF)= ______________
11.
Code a single instruction that clears bits 0, 3, and 4 in the AL
register. 12. What is the binary value of AL after the following
instructions have executed?
mov al,01101011b
shr al,2
三、解釋名詞:
四、程式設計: