Lab6Answers.pdf

This preview shows page 1 - 2 out of 3 pages.

Introduction to Computer Architectures 1 ICAR Laboratory Answers : CPU Sim 2 Task 1 As lab script Task 2 start: input A ; read data stored in mem loc A add 02 ; add immediate value 2 to ACC A: .data 2 100 ; mem loc A, data, 2 bytes, 0x64 B: .data 2 50 ; mem loc B, data, 2 bytes, 0x32 The first two instruction should execute as normal, loading the value 100 (0x64) into the ACC, then adding 2, giving a result of 102 (0x66). The processor will then treat “A: .data 2 100”, as an instruction which has the same binary pattern as load acc 100, therefore, 100 (0x64) will be loaded into the ACC. Next, the processor will then treat “B: .data 2 50”, as an instruction which has the same binary pattern as load acc 50, therefore, 50 (0x32) will be loaded into the ACC. Final, the processor will then treat the next memory locations as instructions which has the same binary pattern as load acc 0, therefore, 0 will be loaded into the ACC. Question , what does .data 2 100 define? What happens if the 2 is replaced with a 1? Rerun the program is the result the same? How have the values stored in memory changed? To allow the programmer to store data in their program the assembler uses the .data directive. Remember the text you have entered is passed to the assembler which
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.

{[ 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