{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Microprocessors HW 2 - Microprocessors HW#2 Joshua...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Microprocessors HW #2 Joshua Scazzero #558617 CPE-286 Chapter 5 (question 45, page 227; question 47, page 227; question 49, page 228) Chapter 6 (question 21, page 293; question 23, page 293) Due: 10/05/06 send to [email protected] Chapter 5 #45 Write a program that will read the word ASCII_DATA, to the current data segment of memory. Disassemble the two bytes and save them as separate characters in the lower byte location, as ASCII_CHAR_L and ASCII_CHAR_H. Use an SHR instruction to relocate the most significant bits. Make the upper eight bits in each of these character storage locations zero. (Note: SHR stands for Shift Logical Right, it shifts right whatever you put as inputs and fills the remaining bits with zero.) Solution: MOV AX, [ASCII_DATA] --Gets the word into AX MOV BX, AX --And BX MOV CL, 08H --This is the bit count set equal to CL SHR BX, CL -- BX gets set equal to the higher character. AND AX, 00FFH --AX gets set equal to the lower character MOV [ASCII_CHAR_L], AX --Save lower character MOV [ASCII_CHAR_H], BX --Save higher character #47 Solution: (a) Rol DX, CL
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern