Download CE 302 Microprocessors Exam I 1) Given that the contents of the

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
CE 302 Microprocessors
Exam I
1) Given that the contents of the 80386 processor registers are defined in hex as follows:
EAX=12345678
ESI=567898BC
CS=A000
EIP=00000100
EBX=23456789
EDI=0000AB88
DS=B001
FLAGS
ECX=00000003
EBP=789ABCDE
ES=C000
TF,OF,IF,PF,CF SET
EDX=456789AB
ESP=89ACDEF0
SS=D002
DF,SF,AF,ZF CLEAR
Given also that the contents of each byte in memory has been initialized to the bit complement of the
low byte of its address. Assuming that each of the instructions below begin with the specified register
and memory state above, indicate the contents of all affected registers and memory locations following
the completion of each instruction. You need not give the status of the flags unless specifically
requested. The number in parentheses, "( )", indicate the number of bytes in the instruction. Assume
that the code was assembled with a USE16 directive.
a. ADD [SI], AL, (2) give contents of SF, PF, OF, CF, and ZF flags
b. INT 17H (2)
2) Please give the contents of registers AX, BX, and CX after the below code segment is executed.
DATAS
LBACK:
DB
MOV
LEA
XOR
MOV
MOV
INC
ADD
DEC
JNZ
SHR
7, 5,4,9,7
AX,3000H
DI,DATAS
BX,BX
AH, [DI+BX]
CX,4
BX
AH,[DI+BX]
CX
LBACK
BX,1
3) Write a FAR procedure named FMAX that finds the biggest number in a list. Assume the list is at
the location with label NUMBERS and it ends with a ‘$’ sign.
4) Write a MACRO named CNT_ONES that counts the number of ones in a single byte given in input
variable X and stores the count in output variable Y . For example, the binary value of 11001011 in X
will result in 05H in output Y.
5) List all 8-bit and 16-bit registers.