Kadyrov_Daniel_Project2_Assembly.pdf - Assembly 2 Project Due on July 7th 2019 Computer Organization Programming CS550WS—Summer I Ed Banduk Daniel

Kadyrov_Daniel_Project2_Assembly.pdf - Assembly 2 Project...

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

Assembly 2 Project Due on July 7th, 2019 Computer Organization & Programming CS550WS—Summer I Ed Banduk Daniel Kadyrov Problem 1. Write and submit the Assembly code for "Hello World" program by using the Notepad Solution 1 START ORG $1000 2 3 LEA MESSAGE ,A1 4 MOVE.B #14,D0 5 TRAP #15 6 7 MOVE.B #9,D0 8 TRAP #15 9 10 MESSAGE DC.B ' HELLO WORLD ' ,0 11 12 13 END START Problem 2. Explain how the stack is used for subroutine call and return Solution A stack stores data in a last-in, first-out structure. In other words, the most recent data stored is the first accessed. A call stack uses this data structure to store the return addresses and arguments of sub- routine calls. Instead of storing the return address in a fixed location and resulting in an infinite loop, the original address is pushed down the stack allowing the program to rewind in the reverse order the routines were entered. A stack pointer points to the most recent entry at the top of the stack. The bottom of the stack is a fixed memory location.
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '16

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

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes