# Hw 3 sol - EEL 3801 Computer Organization Spring 2010 HW#3...

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

JMP CHECK XLAR GER MOV [EDX + ECX],AL Store X byte. CHECK LOOP ST AR T Check if done. EEL 3801 - Computer Organization Spring, 2010 HW #3 Solution 3.51 Initial memory contents are: [1000] = 1 [1004] = 2 [1008] = 3 [1012] = 4 [1016] = 5 [1020] = 6 (a) [EBX + ESI*4 + 8] = 1016 EAX 10 + 5 = 15 (b) The values 20 and 30 are pushed onto the processor stack, and then 30 is popped into EAX and 20 is popped into EBX. The Subtract instruction then performs 30 20, and places the result of 10 into EAX. (c) The address value 1008 is loaded into EAX, and then 3 is loaded in to EBX. 3.54 Assume bytes are unsigned 8-bit values. MOV ECX,N ECX is list coun ter. LEA ESI,X ESI points to X list. SUB ESI,1 LEA EDI,Y EDI points to Y list. SUB EDI,1 LEA ED X,LAR GER EDX points to LARGER list. SUB ED X,1 ST AR T: MOV AL,[ESI + ECX] Load X byte into AL. MOV BL,[EDI + ECX], Load Y byte into BL. CMP AL,BL Compare b ytes. JAE XLAR GER Branch if X byte larger or same. MOV [EDX + ECX],BL Otherwise, store Y byte.

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

View Full Document
MOV ECX,N Use ECX to coun t n um b ers SUB ECX,2 generated after 1.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern