EECE.3170 Microprocessor Systems Design I

Slides:



Advertisements
Similar presentations
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Advertisements

ECE Application Programming
Microprocessor Systems Design I
Microprocessor Systems Design I
ECE Application Programming
Microprocessor Systems Design I
ECE Application Programming
EECE.2160 ECE Application Programming
ECE Application Programming
Microprocessor Systems Design I
Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.2160 ECE Application Programming
ECE Application Programming
Function and class templates
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.2160 ECE Application Programming
CS 336/536: Computer Network Security Fall 2014 Nitesh Saxena
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
ECE Application Programming
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
EECE.2160 ECE Application Programming
EECE.3170 Microprocessor Systems Design I
EECE.2160 ECE Application Programming
EECE.3170 Microprocessor Systems Design I
Instructor: Dr. Michael Geiger Spring 2019 Lecture 29: Linked queues
Instructor: Dr. Michael Geiger Spring 2019 Lecture 4: Functions in C++
EECE.4810/EECE.5730 Operating Systems
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.3170 Microprocessor Systems Design I
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
EECE.2160 ECE Application Programming
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2017
EECE.2160 ECE Application Programming
EECE.3170 Microprocessor Systems Design I
EECE.4810/EECE.5730 Operating Systems
EECE.4810/EECE.5730 Operating Systems
EECE.2160 ECE Application Programming
Presentation transcript:

EECE.3170 Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2016 Lecture 18 HLL  assembly (continued)

Microprocessors I: Lecture 18 Lecture outline Announcements/reminders HW 4 due 2:00 PM today HW 5 to be posted; due 2:00 PM, Wednesday, 10/26 No Thursday office hours until my feet heal Will stay later most M/W (on campus until 4 today) Review: HLL  assembly Conditional statements Loops Today’s lecture: HLL  assembly examples 4/4/2019 Microprocessors I: Lecture 18

Microprocessors I: Exam 2 Preview Review: HLL  assembly Conditional statements (if-then-else) Evaluate condition (CMP instruction(s)) Conditional jump (often to “else” case) “If” case ends with unconditional jump to skip “else” Loops Initialize variable at start Test loop condition (similar to if) Change loop variable 4/4/2019 Microprocessors I: Exam 2 Preview

Microprocessors I: Lecture 6 Practice problems See today’s handout for Description of how stack frame should be created Description of where to access function arguments, local variables Functions to be written int fact(int n): Calculate and return n! int max(int v1, int v2): Return largest value between v1 and v2 void swap(int *a, int *b): Given addresses a & b, swap contents Solutions to be posted as PDF online C versions in slides that follow; assembly in PDF file Will be covered in class today as well 4/4/2019 Microprocessors I: Lecture 6

Microprocessors I: Lecture 6 Factorial in C int fact(int n) { int i; int fact = 1; for (i = n; i > 1; i--) fact *= i; return fact; } 4/4/2019 Microprocessors I: Lecture 6

Maximum value function in C int max(int v1, int v2) { if (v1 > v2) return v1; else return v2; } 4/4/2019 Microprocessors I: Lecture 6

Microprocessors I: Lecture 6 Swap in C void swap(int *a, int *b) { int temp; temp = *a; *a = *b; *b = temp; } 4/4/2019 Microprocessors I: Lecture 6

Microprocessors I: Lecture 18 Final notes Next time: PIC intro Reminders: HW 4 due 2:00 PM today HW 5 to be posted; due 2:00 PM, Wednesday, 10/26 No Thursday office hours until my feet heal Will stay later most M/W (on campus until 4 today) 4/4/2019 Microprocessors I: Lecture 18