{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MidtermSpring2007

# MidtermSpring2007 - Q1[25 pts a[3 pts Represent-2668...

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

Q1) [25 pts] a) [3 pts] Represent -2668 decimal in 32 bit signed arithmetic as a hex value -2668 = FFFFF594 hex b) [3 pts] What is 8DCE h in decimal if we are using 16 bit signed arithmetic 8DCE h = -29234 decimal c) [7 pts] Consider the following program. At ROM address 07FFh, we are to jump to HERE1 or HERE2 or HERE3. For each of the three cases, show which type of jump instructions (LJMP, SJMP, or AJMP) can be used and which one(s) is to be preferred? Explain. Hint. AJMP uses absolute addressing as in ACALL. ROM address – hex Assembly Code Comment 07FF ? ; jump reqired to HERE1-2-3 08xx 0E12 HERE1: MOV A,00h 07B2 HERE2: MOV A,01h 4000 HERE3: MOV A,02h Write your answers in the table below. Jump to Location What is possible What is (are) preferred Explanation for what is possible and what is preferred HERE1 AJMP,LJMP AJMP Takes less code space, 2 bytes vs 3 bytes. AJMP is possible since 08xx and 0E12 are on the same page. LJMP is always possible. HERE2 SJMP,LJMP SJMP Takes less code space 2 bytes vs 3 bytes. AJMP is not possible since 08xx and 07B2 are not on the same 2K page. SJMP is possible since 07B2 is in the (-128,127) neighborhood of 08xx. HERE3 LJMP LJMP

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

View Full Document
d) [12 pts] Write an 8051 assembly language procedure to calculate round(x,y) which is defined as
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

MidtermSpring2007 - Q1[25 pts a[3 pts Represent-2668...

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

View Full Document
Ask a homework question - tutors are online