SlideShare a Scribd company logo
1 of 11
Sheet11-Which of the following is a nonrenewable
resource?aSolar energybHydrogen fuel cellcWind
powerdNatural gas2-Which of the following is a density-
dependent factor?aDecrease in temperaturebIncrease in waste
productioncDecrease in frequency of hurricanesdIncrease in
rainfall3-What structure of dispersion describes high densities
of individuals in certain resource-rich areas and low densities
elsewhere?aClumped distributionbUniform distributioncRandom
dispersiondScattered dispersion4-An owl eating a seed-eating
mouse is an example of what?aProducerbPrimary
consumercSecondary consumerdTertiary consumer5-A
relationship which benefits one species and does not affect the
other is called
__________.amutualismbcommensalismcparasiticdpredatory
EG-CP/EE 280 Microcontrollers
LAB 4, Spring 2016
Instructor: Dr. Jidong Huang
Student Name:
Group Partner:
Objective: This lab covers the use of stack to store temporary
information in an assembly language program.
Equipment and Software provided: PC, Metrowerks
CodeWarrior.
Evaluation: Grade for labs will be based on 1) In-lab activities,
and 2) Lab report
Lab Duration: 2 lab sessions
Lab Report: Lab report based on this instruction sheet will be
collected on Wed., Apr. 6 at the end of the class. The completed
lab report shall be uploaded to Titanium using homework
assignment tool. Name your lab report as
LAB4_EE280_YourName.doc, e.g.,
LAB4_EE280_DoeJohn.doc.
Lab Activity:
For the following lab activities, please create your test project
using the cpe280 project template as provided in Code Warrior.
For each coding task, you may fill in the code in cpe280 asm
file under the main section below “Entry:”.
1. Practicing the use of Stack
a. An Example
Implement the following program in CodeWarrior
NUM1 EQU $15
NUM2 EQU $2F
LDS #$3C00
LDAA #NUM1
LDAB #NUM2
PSHA
PSHB
CLRA
CLRB
PULB
PULA
Please step through (F11) the program and observe how register
value and memory content changes as you step through the
code. Please record the results after you execute each
instruction code starting from the first line.
Instructions
A
B
SP
M[$3BFE]
M[$3BFF]
M[$3C00]
LDS #$3C00
LDAA #NUM1
LDAB #NUM2
PSHA
PSHB
CLRA
CLRB
PULB
PULA
Now, implement the following program in CodeWarrior
NUM1 EQU $15
NUM2 EQU $2F
LDS #$3C00
LDAA #NUM1
LDAB #NUM2
PSHA
PSHB
CLRA
CLRB
PULA
PULB
Please step through (F11) the program and observe how register
value and memory content changes as you step through the
code. Please record the results after you execute each
instruction code starting from PSHA.
Instructions
A
B
SP
M[$3BFE]
M[$3BFF]
M[$3C00]
PSHA
PSHB
CLRA
CLRB
PULA
PULB
Do you notice any difference in the final results between this
program and the previous one? Can you explain why?
2. Design and Implementation of Assembly Programs using
Stack
Based on what you have learned so far, design and implement
some small programs that complete the following tasks.
a. Task 1: Use stack to move data between memory locations.
Now design a program to swap the memory contents for the two
memory arrays.
Before you start moving data between the two memory
locations, please use appropriate directives under “Data
Definition Section” to initialize the following memory bytes as:
M[$2050] = $32, M[$2051] = $28, M[$2052] = $81,
M[$2053] = $71,
M[$2060] = $27, M[$2061] = $8c, M[$2062] = $50, M[$2063]
= $6a,
Basically, you need to write a program to swap the memory
contents between $2050 and $2060; $2051 and $2061; $2052
and $2062; and $2053 and $2063. That is to say,
M[$2060] = M[$2050]_old = $32,
M[$2050] = M[$2060]_old = $27,
M[$2061] = M[$2051]_old = $28,
M[$2051] = M[$2061]_old = $8c,
M[$2062] = M[$2052]_old = $81,
M[$2052] = M[$2062]_old = $50,
M[$2063] = M[$2053]_old = $71,
M[$2053] = M[$2063]_old = $6a,
In your program, please use stack as the location for storing
temporary data. Please initialize your stack pointer to be $3C00.
You can then follow the following steps to move the data
between two locations.
1) Move 4 bytes from memory location A to the stack
2) Move 4 bytes from memory location B to the stack
3) Move 4 bytes from the stack to memory location A
4) Move 4 bytes from the stack to memory location B
Please use branch instructions to create loops for moving data
to and from the stack.
Your program is:
The CodeWarrior test result is:
Register and memory window before the swap:
Register and memory window after the swap:
b. Task 2: Sorting an Array.
Now, design a program to sort the data in an array.
In the first part of your program, you shall use appropriate
directives to store the following 5 unsigned numbers: $1C, $5D,
$72, $48, $32 into the memory locations starting from $2000.
Also initialize your stack pointer to be $3C00.
In your program, assume that you know the size of the array,
meaning you can use a fixed loop counter like 5 to end your
iteration.
For sorting numbers, there are many ways to sort the data in an
array. The following algorithm is one way of sorting the data in
an array.
1) Based on the number of data in an array, search for the
largest number in the array and remember its memory location.
To end your search, you may use index addressing 0, X to
access data and then compare the index X value to the end
location of the memory array, i.e. $2004.
2) Once you find the largest number in an array, push it into a
stack, and fill in the memory location as $00. For example, after
first round of search, starting from memory location $2000, the
data in the array becomes: $1C $5D $00 $48 $32; and the
largest number in the array is now in the stack, i.e. M[$3BFF] =
$72. Similarly, after two rounds of search, the data in the array
becomes $1C $00 $00 $48 $32; and the largest and the second
largest number in the array are now in the stack, i.e. M[$3BFE]
= $5D M[$3BFF] = $72.
3) Repeat step 2 for 5 times
4) Retrieve data from the stack and save them to specified
memory locations.
Please sort the data in the array using a descending order.
Basically, this means the results of your program shall be:
M[2010] = 72; M[2011] = $5D; M[2012] = $48; M[2013] = $32;
M[2014] = $1C;
Your program is:
The CodeWarrior test result is:
Register and memory window before the sorting:
Register and memory window after the sorting:
PAGE
4
Sheet11-Which of the following is a nonrenewable resourceaSolar e.docx

More Related Content

Similar to Sheet11-Which of the following is a nonrenewable resourceaSolar e.docx

COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docxEN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
YASHU40
 
Clustering_Algorithm_DR
Clustering_Algorithm_DRClustering_Algorithm_DR
Clustering_Algorithm_DR
Nguyen Tran
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
ecomputernotes
 
Sql portfolio admin_practicals
Sql portfolio admin_practicalsSql portfolio admin_practicals
Sql portfolio admin_practicals
Shelli Ciaschini
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
Mahmoud
 
C basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kellaC basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kella
Manoj Kumar kothagulla
 

Similar to Sheet11-Which of the following is a nonrenewable resourceaSolar e.docx (20)

COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
 
The Other HPC: High Productivity Computing
The Other HPC: High Productivity ComputingThe Other HPC: High Productivity Computing
The Other HPC: High Productivity Computing
 
Hadoop
HadoopHadoop
Hadoop
 
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docxEN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
EN1320 Module 2 Lab 2.1Capturing the Reader’s InterestSelec.docx
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQL
 
Clustering_Algorithm_DR
Clustering_Algorithm_DRClustering_Algorithm_DR
Clustering_Algorithm_DR
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
 
Surpac geological modelling 3
Surpac geological modelling 3Surpac geological modelling 3
Surpac geological modelling 3
 
Scaling Analytics with Apache Spark
Scaling Analytics with Apache SparkScaling Analytics with Apache Spark
Scaling Analytics with Apache Spark
 
Productive Use of the Apache Spark Prompt with Sam Penrose
Productive Use of the Apache Spark Prompt with Sam PenroseProductive Use of the Apache Spark Prompt with Sam Penrose
Productive Use of the Apache Spark Prompt with Sam Penrose
 
Bill howe 2_databases
Bill howe 2_databasesBill howe 2_databases
Bill howe 2_databases
 
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
 
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdf
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdfVikas 500 BIG DATA TECHNOLOGIES LAB.pdf
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdf
 
Sql portfolio admin_practicals
Sql portfolio admin_practicalsSql portfolio admin_practicals
Sql portfolio admin_practicals
 
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
MongoDB World 2019: Lessons Learned: Migrating Buffer's Production Database t...
 
Efficient Pseudo-Relevance Feedback Methods for Collaborative Filtering Recom...
Efficient Pseudo-Relevance Feedback Methods for Collaborative Filtering Recom...Efficient Pseudo-Relevance Feedback Methods for Collaborative Filtering Recom...
Efficient Pseudo-Relevance Feedback Methods for Collaborative Filtering Recom...
 
Detection Of Fraudlent Behavior In Water Consumption Using A Data Mining Base...
Detection Of Fraudlent Behavior In Water Consumption Using A Data Mining Base...Detection Of Fraudlent Behavior In Water Consumption Using A Data Mining Base...
Detection Of Fraudlent Behavior In Water Consumption Using A Data Mining Base...
 
pradeep ppt final.pptx
pradeep ppt final.pptxpradeep ppt final.pptx
pradeep ppt final.pptx
 
Assignment2 A
Assignment2 AAssignment2 A
Assignment2 A
 
C basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kellaC basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kella
 

More from bagotjesusa

Issues Identify at least seven issues you see in the case1..docx
Issues Identify at least seven issues you see in the case1..docxIssues Identify at least seven issues you see in the case1..docx
Issues Identify at least seven issues you see in the case1..docx
bagotjesusa
 
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010 VOLUME 13 .docx
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010    VOLUME 13 .docxISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010    VOLUME 13 .docx
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010 VOLUME 13 .docx
bagotjesusa
 
ISSA Journal September 2008Article Title Article Author.docx
ISSA Journal  September 2008Article Title  Article Author.docxISSA Journal  September 2008Article Title  Article Author.docx
ISSA Journal September 2008Article Title Article Author.docx
bagotjesusa
 
ISOL 536Security Architecture and DesignThreat Modeling.docx
ISOL 536Security Architecture and DesignThreat Modeling.docxISOL 536Security Architecture and DesignThreat Modeling.docx
ISOL 536Security Architecture and DesignThreat Modeling.docx
bagotjesusa
 
ISOL 533 Project Part 1OverviewWrite paper in sections.docx
ISOL 533 Project Part 1OverviewWrite paper in sections.docxISOL 533 Project Part 1OverviewWrite paper in sections.docx
ISOL 533 Project Part 1OverviewWrite paper in sections.docx
bagotjesusa
 
Is the United States of America a democracyDetailed Outline.docx
Is the United States of America a democracyDetailed Outline.docxIs the United States of America a democracyDetailed Outline.docx
Is the United States of America a democracyDetailed Outline.docx
bagotjesusa
 
IS-365 Writing Rubric Last updated January 15, 2018 .docx
IS-365 Writing Rubric Last updated January 15, 2018   .docxIS-365 Writing Rubric Last updated January 15, 2018   .docx
IS-365 Writing Rubric Last updated January 15, 2018 .docx
bagotjesusa
 
ISAS 600 – Database Project Phase III RubricAs the final ste.docx
ISAS 600 – Database Project Phase III RubricAs the final ste.docxISAS 600 – Database Project Phase III RubricAs the final ste.docx
ISAS 600 – Database Project Phase III RubricAs the final ste.docx
bagotjesusa
 
Is Texas so conservative- (at least for the time being)- as many pun.docx
Is Texas so conservative- (at least for the time being)- as many pun.docxIs Texas so conservative- (at least for the time being)- as many pun.docx
Is Texas so conservative- (at least for the time being)- as many pun.docx
bagotjesusa
 
irem.orgjpm jpm® 47AND REWARDRISK .docx
irem.orgjpm      jpm®      47AND  REWARDRISK .docxirem.orgjpm      jpm®      47AND  REWARDRISK .docx
irem.orgjpm jpm® 47AND REWARDRISK .docx
bagotjesusa
 
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docxIoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
bagotjesusa
 
Investigative Statement AnalysisInitial statement given by Ted K.docx
Investigative Statement AnalysisInitial statement given by Ted K.docxInvestigative Statement AnalysisInitial statement given by Ted K.docx
Investigative Statement AnalysisInitial statement given by Ted K.docx
bagotjesusa
 
Investigating Happiness at College SNAPSHOT T.docx
Investigating   Happiness   at   College  SNAPSHOT  T.docxInvestigating   Happiness   at   College  SNAPSHOT  T.docx
Investigating Happiness at College SNAPSHOT T.docx
bagotjesusa
 

More from bagotjesusa (20)

Issues Identify at least seven issues you see in the case1..docx
Issues Identify at least seven issues you see in the case1..docxIssues Identify at least seven issues you see in the case1..docx
Issues Identify at least seven issues you see in the case1..docx
 
Issues and disagreements between management and employees lead.docx
Issues and disagreements between management and employees lead.docxIssues and disagreements between management and employees lead.docx
Issues and disagreements between management and employees lead.docx
 
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010 VOLUME 13 .docx
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010    VOLUME 13 .docxISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010    VOLUME 13 .docx
ISSN1369 7021 © Elsevier Ltd 2010DECEMBER 2010 VOLUME 13 .docx
 
ISSA Journal September 2008Article Title Article Author.docx
ISSA Journal  September 2008Article Title  Article Author.docxISSA Journal  September 2008Article Title  Article Author.docx
ISSA Journal September 2008Article Title Article Author.docx
 
ISOL 536Security Architecture and DesignThreat Modeling.docx
ISOL 536Security Architecture and DesignThreat Modeling.docxISOL 536Security Architecture and DesignThreat Modeling.docx
ISOL 536Security Architecture and DesignThreat Modeling.docx
 
ISOL 533 Project Part 1OverviewWrite paper in sections.docx
ISOL 533 Project Part 1OverviewWrite paper in sections.docxISOL 533 Project Part 1OverviewWrite paper in sections.docx
ISOL 533 Project Part 1OverviewWrite paper in sections.docx
 
Is the United States of America a democracyDetailed Outline.docx
Is the United States of America a democracyDetailed Outline.docxIs the United States of America a democracyDetailed Outline.docx
Is the United States of America a democracyDetailed Outline.docx
 
Islamic Profession of Faith (There is no God but God and Muhammad is.docx
Islamic Profession of Faith (There is no God but God and Muhammad is.docxIslamic Profession of Faith (There is no God but God and Muhammad is.docx
Islamic Profession of Faith (There is no God but God and Muhammad is.docx
 
IS-365 Writing Rubric Last updated January 15, 2018 .docx
IS-365 Writing Rubric Last updated January 15, 2018   .docxIS-365 Writing Rubric Last updated January 15, 2018   .docx
IS-365 Writing Rubric Last updated January 15, 2018 .docx
 
ISAS 600 – Database Project Phase III RubricAs the final ste.docx
ISAS 600 – Database Project Phase III RubricAs the final ste.docxISAS 600 – Database Project Phase III RubricAs the final ste.docx
ISAS 600 – Database Project Phase III RubricAs the final ste.docx
 
Is teenage pregnancy a social problem How does this topic reflect.docx
Is teenage pregnancy a social problem How does this topic reflect.docxIs teenage pregnancy a social problem How does this topic reflect.docx
Is teenage pregnancy a social problem How does this topic reflect.docx
 
Is Texas so conservative- (at least for the time being)- as many pun.docx
Is Texas so conservative- (at least for the time being)- as many pun.docxIs Texas so conservative- (at least for the time being)- as many pun.docx
Is Texas so conservative- (at least for the time being)- as many pun.docx
 
Irreplaceable Personal Objects and Cultural IdentityThink of .docx
Irreplaceable Personal Objects and Cultural IdentityThink of .docxIrreplaceable Personal Objects and Cultural IdentityThink of .docx
Irreplaceable Personal Objects and Cultural IdentityThink of .docx
 
IRB is an important step in research. State the required components .docx
IRB is an important step in research. State the required components .docxIRB is an important step in research. State the required components .docx
IRB is an important step in research. State the required components .docx
 
irem.orgjpm jpm® 47AND REWARDRISK .docx
irem.orgjpm      jpm®      47AND  REWARDRISK .docxirem.orgjpm      jpm®      47AND  REWARDRISK .docx
irem.orgjpm jpm® 47AND REWARDRISK .docx
 
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docxIoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
 
In two paragraphs, respond to the prompt below. Journal entries .docx
In two paragraphs, respond to the prompt below. Journal entries .docxIn two paragraphs, respond to the prompt below. Journal entries .docx
In two paragraphs, respond to the prompt below. Journal entries .docx
 
Investigative Statement AnalysisInitial statement given by Ted K.docx
Investigative Statement AnalysisInitial statement given by Ted K.docxInvestigative Statement AnalysisInitial statement given by Ted K.docx
Investigative Statement AnalysisInitial statement given by Ted K.docx
 
Investigating Happiness at College SNAPSHOT T.docx
Investigating   Happiness   at   College  SNAPSHOT  T.docxInvestigating   Happiness   at   College  SNAPSHOT  T.docx
Investigating Happiness at College SNAPSHOT T.docx
 
Investigate Development Case Death with Dignity Physician-Assiste.docx
Investigate Development Case Death with Dignity  Physician-Assiste.docxInvestigate Development Case Death with Dignity  Physician-Assiste.docx
Investigate Development Case Death with Dignity Physician-Assiste.docx
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Sheet11-Which of the following is a nonrenewable resourceaSolar e.docx

  • 1. Sheet11-Which of the following is a nonrenewable resource?aSolar energybHydrogen fuel cellcWind powerdNatural gas2-Which of the following is a density- dependent factor?aDecrease in temperaturebIncrease in waste productioncDecrease in frequency of hurricanesdIncrease in rainfall3-What structure of dispersion describes high densities of individuals in certain resource-rich areas and low densities elsewhere?aClumped distributionbUniform distributioncRandom dispersiondScattered dispersion4-An owl eating a seed-eating mouse is an example of what?aProducerbPrimary consumercSecondary consumerdTertiary consumer5-A relationship which benefits one species and does not affect the other is called __________.amutualismbcommensalismcparasiticdpredatory EG-CP/EE 280 Microcontrollers LAB 4, Spring 2016 Instructor: Dr. Jidong Huang Student Name: Group Partner: Objective: This lab covers the use of stack to store temporary information in an assembly language program. Equipment and Software provided: PC, Metrowerks CodeWarrior. Evaluation: Grade for labs will be based on 1) In-lab activities, and 2) Lab report Lab Duration: 2 lab sessions
  • 2. Lab Report: Lab report based on this instruction sheet will be collected on Wed., Apr. 6 at the end of the class. The completed lab report shall be uploaded to Titanium using homework assignment tool. Name your lab report as LAB4_EE280_YourName.doc, e.g., LAB4_EE280_DoeJohn.doc. Lab Activity: For the following lab activities, please create your test project using the cpe280 project template as provided in Code Warrior. For each coding task, you may fill in the code in cpe280 asm file under the main section below “Entry:”. 1. Practicing the use of Stack a. An Example Implement the following program in CodeWarrior NUM1 EQU $15 NUM2 EQU $2F LDS #$3C00 LDAA #NUM1 LDAB #NUM2 PSHA PSHB CLRA CLRB PULB
  • 3. PULA Please step through (F11) the program and observe how register value and memory content changes as you step through the code. Please record the results after you execute each instruction code starting from the first line. Instructions A B SP M[$3BFE] M[$3BFF] M[$3C00] LDS #$3C00 LDAA #NUM1 LDAB #NUM2 PSHA
  • 5. Now, implement the following program in CodeWarrior NUM1 EQU $15 NUM2 EQU $2F LDS #$3C00 LDAA #NUM1 LDAB #NUM2 PSHA PSHB CLRA CLRB PULA PULB Please step through (F11) the program and observe how register value and memory content changes as you step through the code. Please record the results after you execute each instruction code starting from PSHA. Instructions A B SP M[$3BFE] M[$3BFF] M[$3C00]
  • 7. Do you notice any difference in the final results between this program and the previous one? Can you explain why? 2. Design and Implementation of Assembly Programs using Stack Based on what you have learned so far, design and implement some small programs that complete the following tasks. a. Task 1: Use stack to move data between memory locations. Now design a program to swap the memory contents for the two memory arrays. Before you start moving data between the two memory locations, please use appropriate directives under “Data Definition Section” to initialize the following memory bytes as: M[$2050] = $32, M[$2051] = $28, M[$2052] = $81, M[$2053] = $71, M[$2060] = $27, M[$2061] = $8c, M[$2062] = $50, M[$2063] = $6a,
  • 8. Basically, you need to write a program to swap the memory contents between $2050 and $2060; $2051 and $2061; $2052 and $2062; and $2053 and $2063. That is to say, M[$2060] = M[$2050]_old = $32, M[$2050] = M[$2060]_old = $27, M[$2061] = M[$2051]_old = $28, M[$2051] = M[$2061]_old = $8c, M[$2062] = M[$2052]_old = $81, M[$2052] = M[$2062]_old = $50, M[$2063] = M[$2053]_old = $71, M[$2053] = M[$2063]_old = $6a, In your program, please use stack as the location for storing temporary data. Please initialize your stack pointer to be $3C00. You can then follow the following steps to move the data between two locations.
  • 9. 1) Move 4 bytes from memory location A to the stack 2) Move 4 bytes from memory location B to the stack 3) Move 4 bytes from the stack to memory location A 4) Move 4 bytes from the stack to memory location B Please use branch instructions to create loops for moving data to and from the stack. Your program is: The CodeWarrior test result is: Register and memory window before the swap: Register and memory window after the swap: b. Task 2: Sorting an Array. Now, design a program to sort the data in an array. In the first part of your program, you shall use appropriate directives to store the following 5 unsigned numbers: $1C, $5D, $72, $48, $32 into the memory locations starting from $2000. Also initialize your stack pointer to be $3C00. In your program, assume that you know the size of the array, meaning you can use a fixed loop counter like 5 to end your iteration. For sorting numbers, there are many ways to sort the data in an array. The following algorithm is one way of sorting the data in an array. 1) Based on the number of data in an array, search for the largest number in the array and remember its memory location. To end your search, you may use index addressing 0, X to access data and then compare the index X value to the end
  • 10. location of the memory array, i.e. $2004. 2) Once you find the largest number in an array, push it into a stack, and fill in the memory location as $00. For example, after first round of search, starting from memory location $2000, the data in the array becomes: $1C $5D $00 $48 $32; and the largest number in the array is now in the stack, i.e. M[$3BFF] = $72. Similarly, after two rounds of search, the data in the array becomes $1C $00 $00 $48 $32; and the largest and the second largest number in the array are now in the stack, i.e. M[$3BFE] = $5D M[$3BFF] = $72. 3) Repeat step 2 for 5 times 4) Retrieve data from the stack and save them to specified memory locations. Please sort the data in the array using a descending order. Basically, this means the results of your program shall be: M[2010] = 72; M[2011] = $5D; M[2012] = $48; M[2013] = $32; M[2014] = $1C; Your program is: The CodeWarrior test result is: Register and memory window before the sorting: Register and memory window after the sorting: PAGE 4