Chapter 1 What is Programming?

Chapter 1 What is Programming?

Peer Instruction #7: Memory Model/Stack Convention Why not discard the stack convention and just use register passing? A. B. C. D. E. Without stack, recursion is impossible No alternative memory models exist Overall, no better approach exists

Number of registers is too limited Register passing is too complicated Stack Convention CS 270, Spring Semester 2016 3 Which of the following is not stored on the stack? A. B. C.

D. E. Dynamic allocations Function parameters Return values Local variables Return addresses Stack Convention CS 270, Spring Semester 2016 4

Does the caller or callee have to push function parameters? A. Caller function B. Callee function C. Either, depending on the protocol Stack Convention CS 270, Spring Semester 2016 5 Does the caller or callee have to pop

the return value of a function? A. Caller function B. Callee function C. Either, depending on the protocol Stack Convention CS 270, Spring Semester 2016 6 Does the caller or callee have to allocate space for the return value? A. Caller function

B. Callee function C. Either, depending on the protocol Stack Convention CS 270, Spring Semester 2016 7 Why is it necessary to have both a frame pointer and stack pointer? A. Because the stack pointer is volatile, and constantly changes B. Because the stack pointer is shared

between all functions C. To have a stable pointer for accessing function parameters and locals D. All of the above Frame Pointer CS 270, Spring Semester 2016 8 What does the following LC-3 assembly code do? ADD R6,R6,#-1 STR R5,R6,#0

LDR R5,R6,#0 ADD R6,R6,#1 A. Initializes the frame and stack pointer B. Pushes and pops the frame pointer C. Pushes and pops the return address Frame Pointer CS 270, Spring Semester 2016 9

Recently Viewed Presentations

  • Welcome to Downingtown East - Downingtown Area School ...

    Welcome to Downingtown East - Downingtown Area School ...

    Course Levels. Level 2 courses are designed for students who read below grade level. Level 1 courses are college preparatory courses. Honors courses are rigorous, in-depth study through interpretation, application, analysis and synthesis of course concepts
  • TRADITIONAL USE OF FORCE LAW DOCTRINE Prof David

    TRADITIONAL USE OF FORCE LAW DOCTRINE Prof David

    ICJ TREATMENTS ICJ Cases Corfu Channel Case, limitation on strict Article 2(4) reading Nicaragua Case, politically charged addressing indirect aggression, but literalist focus Since 1980s, Persian Gulf cases filed but settled or inconclusive (Iran Flight 655, Oil Platforms, etc) PROPORTIONALITY...
  • Présentation PowerPoint

    Présentation PowerPoint

    INTERPOLES - Thesaurus. SOMMAIRE. 2016-01-20. THESAURUS . Definition and use. SOMMAIRE. THESAURUS - DEFINITION. What is a thesaurus? Dictionary in the form of organized list of terms. Top Concepts. Notions of hierarchy. Broader (Parent term) Narrower (Child-term)
  • Nefes Darliği İle Baş Edebi̇lme Yöntemleri̇

    Nefes Darliği İle Baş Edebi̇lme Yöntemleri̇

    Breathing rate Anxiety Dyspnea Yu, J Psychosom Res, 2007 * Progressive muscle relaxation * Forward leaning * Forward Leaning Barach, 1974 Sharp, 1980 Druz, 1982 Delgato, 1982 O'Neil, 1983 Reduces scalen and sternomastoid muscles activities Increases transdiaphragmatic pressure Regulatesthoracoabdominal motions...
  • Energy drinks are big business around the world

    Energy drinks are big business around the world

    The Market is Australia A$550 million New Zealand NZ$171 million Growth of ~20% Target demographic 16-34 year olds Key Competitors V 60% share NZ / 31% share Aust Red Bull 20% share NZ / 34% share Aust There are many...
  • Bellringer - calhoun.k12.al.us

    Bellringer - calhoun.k12.al.us

    Unstable Nuclei and Radioactive Decay Objectives: 9.0 Distinguish between chemical and nuclear reactions. 9.3 Identifying types of radiation and their properties AOD C.9.4 Identify nuclear reactions as those types involving nuclear particles, including alpha particles, beta particles, and gamma rays.
  • The Amazing Race: LIVE in your classroom!

    The Amazing Race: LIVE in your classroom!

    Idea of the game. The object of The Amazing Race: LIVE in your classroom is for teams of 2-4 players to complete a series of clues and be the first team to return to the "Finish Line".. Depending on your...
  • KDHE PowerPoint Template

    KDHE PowerPoint Template

    Most cyanobacteria toxins are classified into two categories: hepatotoxins (toxins that target the liver) and neurotoxins (toxins that target the nervous system). Microcystin, a hepatotoxin produced by cyanobacteria, is the most frequently occurring and widespread cyanotoxin in the world and...