






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to the final examination of the computer organization and programming course offered by the department of electrical and computer engineering at the university of illinois at chicago during the academic year 2003. The solutions cover various topics such as binary representation, unsigned and signed integer arithmetic, and assembly language instructions.
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!







2002 University of Illinois at Chicago ECE 267 V. Goncharoff.
De Deppaarrttmmeenntt ooff ElEleeccttrriiccaall aanndd CCoommppuutteerr EnEnggiinneeeerriinngg
IMPORTANT: Please be aware that academic dishonesty will result in grade “E” for the course, and possibly dismissal from the University. Looking at another exam paper, showing someone your exam paper, or otherwise communicating exam problem information to/from another student is considered to be academically dishonest. Should you have any questions about this policy or about any of the exam questions, please ask me for clarification. -Vladimir Goncharoff
and eax, 7FFFFFFFh
ror eax, add al,2 or: add eax, 01000000h rol eax,
(1 pt.)
(1 pt.)
(1 pt.)
(1 pt.)
(1 pt.)
(2 pts.)
(2 pts.)
.IF (eax >= 500) add eax,ebx .ELSEIF (eax <= 25) sub eax,ebx .ELSE mov eax,ebx .ENDIF
(3 pts.)
cmp eax, jae AE_ cmp eax, jbe BE_ mov eax,ebx jmp Next
AE_500: add eax,ebx jmp Next
BE_25: sub eax,ebx
Next:
.IF (al >= '0') && (al <= '9') call Writechar .ELSE call Crlf .ENDIF
(2 pts.)
Compute PROC LOCAL X[200]:SDWORD mov X[0],- mov X[4], call Some_other_procedure ret Compute ENDP
(3 pts.)
Compute PROC
push ebp mov ebp,esp sub esp, mov SDWORD PTR [ebp-800],- mov SDWORD PTR [ebp-800+4], call Some_other_procedure mov esp,ebp pop ebp ret
Compute ENDP
or eax, 0E0000000h
and eax, 1FFFFFFFh
(2 pts.)
(2 pts.)
(3 pts.)
(2 pts.)
mSquare_Root_EAX MACRO LOCAL ftemp .data ftemp REAL4? .code finit mov ftemp,eax fld ftemp fsqrt fstp ftemp mov eax,ftemp ENDM
Reverse_EAX PROC USES ebx ecx
mov ecx, A1: shr eax, rcl ebx, loop A
mov eax,ebx ret
Reverse_EAX ENDP
(3 pts.)
Cube_Root_EAX PROC USES ecx
.data X REAL4? Y REAL4? ftwo REAL4 2. fthree REAL4 3. .code
finit mov X,eax mov Y,eax mov ecx,
A1: fld X fld Y fld Y fmul fdiv fld Y fld ftwo fmul fadd fld fthree fdiv fstp Y loop A
mov eax,X ret
Cube_Root_EAX ENDP
mProduct reg1, reg2, reg
mProduct MACRO reg1,reg2,reg
LOCAL temp .data temp DWORD? .code
push eax push edx mov temp,reg mov eax,reg mul temp mov temp,eax pop edx pop eax mov reg1,temp
ENDM
(2 pts.)