MidtermSummer2007

# MidtermSummer2007 - BILKENT UNIVERSITY Electrical and...

This preview shows pages 1–5. Sign up to view the full content.

29-06-2007 BILKENT UNIVERSITY Electrical and Electronics Engineering Dept. EEE212 Microprocessors SECTIONS 1-2 Midterm Closed Book – No Calculators All programs need to be in assembly language! Duration: 2.5 hours Surname:________________ SOLUTION ____________ Name:_________________________________________ ID-Number:_____________ SECTION: ___ 1,2 ______ Signature:_______________________________________ Q1 (25 points) Q2 (25 points) Q3 (25 points) Q4 (25 points) TOTAL

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1 Q1) a) [4 pts] Convert FC5A h to decimal considering 16-bit 2’s complement representation. FC5A h = - 934 decimal b) [9 pts] For the following program, determine the range of the ROM addresses (in hexadecimal) corresponding to the labels AGAIN, OVER and THERE. Use the table below for your answer by inserting the minimum and maximum possible locations in the ROM space for each label. PC (in hex) Mnemonic-Operand 0300 SJMP AGAIN 0302 0315 JZ OVER 0317 035A LJMP THERE 035D Minimum ROM address Maximum ROM address AGAIN 0282 0381 OVER 0297 0396 THERE 0000 FFFF
2 c) [12 pts] For the following assembly program, determine the final values of A, P2, R3, R4 and R7 (all in hexadecimal). CLR RS0 CLR RS1 MOV R1, #0B7H MOV R2, #05H MOV R3, #82H MOV R4, #33H MOV R5, #9AH MOV R0, 2 MOV A, R3 ADD A, @R0 JNC OVER MOV R4, A SJMP LAST OVER: MOV R3, A LAST: JB ACC.0, ODD MOV P2,#‘E’ ; ‘E’ has ASCII code of 45H SJMP FINAL ODD: MOV P2,#‘O’ ; ‘O’ has ASCII code of 4FH FINAL: MOV R6, A AGAIN: ADD A, 05 DJNZ R2, AGAIN MOV R7, A MOV A, R6 A= 1C P2= 45 R3= 82 R4= 1C R7= 1E

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
3 Q2) In the ROM locations, starting from address 500H, there are 20 numbers each of which is 16 bits represented with 2’s complement representation. (Ex: 16-bit ABCD number. AB is stored at 500H, CD is
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 11

MidtermSummer2007 - BILKENT UNIVERSITY Electrical and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online