Chapter 7 Low-Level Programming Languages. 2 Features in Pep/7 Figure 7.1 Pep/7’s architecture.

Slides:



Advertisements
Similar presentations
Instruction Sets: Characteristics and Functions Addressing Modes
Advertisements

Low-Level Programming Languages and Pseudocode
ITEC 352 Lecture 13 ISA(4).
Programming 68HC11.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Low-Level Programming Languages and Pseudocode Chapter 6.
Low-Level Programming Languages and Pseudocode Chapter 6.
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
LC-3 Computer LC-3 Instructions
Assembly Language and Computer Architecture Using C++ and Java
Low-Level Programming Languages
Assembly Language and Computer Architecture Using C++ and Java
Dr Verbrugge Simulated Machine Simulated Machine Problem: Find the Average of the following three numbers: 5, 7, 10 Average = 7 with a remainder of 1.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Negative Numbers Module M3.3 Section 2.4. Negative Numbers Subtract by adding ’s complement Ignore carry.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Computer Architecture
Adding Integers. Adding Integers with the Same Sign Add the absolute values. The sum will have the same sign as the addends. Example 1 Find –2 + (-3)
Positive and Negative Numbers
Assembly & Machine Languages
ADDING INTEGERS Positive + Positive = Positive Positive + Positive = Positive ( +3) + (+2) = +5 ( +3) + (+2) = +5 When a number is positive, you do not.
Rules of Integers. Positive numbers are numbers that are above zero. Negative numbers are numbers below zero.
CPS120: Introduction to Computer Science
CPS120: Introduction to Computer Science Midterm Exam Review.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
CPS Today’s topics Machine Architecture More Low-level Programming Upcoming Language Translation ( G.I. Chapter 9) Reading Great Ideas, Chapters.
Computer Science 101 Assembly Language. Problems with Machine Language Uses binary - No English-like words to make it more readable Uses binary - No English-like.
Lesson 2-2 Adding and Subtracting Rational Numbers.
Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.
Lecture 4 ( Assembly Language).
Adding Integers. Zero Pair = 0 Why it works… __________ Property says you can add or subtract zero without changing the value of an expression.
Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
CPS120: Introduction to Computer Science Midterm Exam Review.
Copyright © 2012, 2009, 2005, 2002 Pearson Education, Inc. Chapter 9 Signed Numbers.
Dale & Lewis Chapter 5 Computing components
CHAPTER 4 Negative Numbers. ADDITION AND SUBTRACTION USING NEGATIVE NUMBERS A number line is very useful when you have to do additions or subtractions.
Branch Addressing op rs rt address address beq $s1, $s2, Label if ($s1 = =$s2) go to Label 6 bits 5 bits 5 bits 16 bits effective 32 bit address.
An Adder A Subtractor. A and B are the inputs of the adder/ subtractor R is the output of the adder/ subtractor F is the control to tell it to add or.
Reverse Subtraction Objectives:  do a subtract by adding  check your answer by adding.
Unit 1 Rational Numbers Integers.
Translating Assembly Language to Machine Language.
Chapter 10, Part 2 Diamond Problems Factoring 4/13/20101Medina.
Chapter 7: Low-Level Programming Languages Chapter 7 Low-Level Programming Languages Page 66 In order to execute instructions on a CPU, those instructions.
Based on slides from D. Patterson and www-inst.eecs.berkeley.edu/~cs152/ COM 249 – Computer Organization and Assembly Language Chapter 3 Arithmetic For.
FIGURES FOR CHAPTER 1 GETTING STARTED
Computer Architecture & Operations I
CS-401 Assembly Language Programming
Computer Architecture & Operations I
Figure 8.1 Architecture of a Simple Computer System.
Figure 8.1 Architecture of a Simple Computer System.
Figure 2- 1: ARM Registers Data Size
Low Level Programming Languages
Objective - To add and subtract decimals.
MARIE: An Introduction to a Simple Computer
Chapter 4: Representing instructions
CS-401 Assembly Language Programming
CPU has 6 special locations called registers
Representing Integers
CS 286 Computer Organization and Architecture
L8-2 Notes: Adding Integers
CS-401 Computer Architecture and Assembly Language Programming
Presentation transcript:

Chapter 7 Low-Level Programming Languages

2 Features in Pep/7 Figure 7.1 Pep/7’s architecture

3 Instruction Format Figure 7.2 The Pep/7 instruction format

4 Instruction Format Figure 7.3 Difference between immediate-mode and direct-mode addressing

5 Some Sample Instructions Figure 7.3 Subset of Pep/7 instructions

6 Sample Instructions

7

8

9

10 Algorithms Write "H" Write 48 (hex) Write "e" Write 65 (hex). Write "o" Write 6F (hex)

11 A Program Example

12 Hand Simulation

13 Hand Simulation

14 Hand Simulation

15 Pep/7 Simulator

16 Pep/7 Simulator

17 Pep/7 Assembly Language

18 Pep/7 Assembly Language

19 Assembly Process

20 A New Program Reading and adding three numbers Set sum to 0 Read num1 Add num1 to sum Read num2 Add num2 to sum Read num3 Add num3 to sum Write sum

21 Our Completed Program

22 Decision Making

23 Decision Making … Add num3 to sum If sum is negative Write "Error" Else Write sum Write "Error" if sum is negative.

24 Decision Making Add num3 to sum If status bit N is 1 Go to NegMsg Write sum Quit: STOP NegMsg: Write the message and go to Quit

25 Decision Making Read limit Set sum to 0 While (limit is not zero) Read number Set sum to sum + number Set limit to limit - 1

26 Decision Making Set the accumulator to limit Subtract one from the accumulator Compare accumulator to zero If status bit Z is 1 go to Quit Else go to Read

27 Decision Making

What do you think? Suppose the government no longer required physical crash tests for new cars. What factors might you consider before buying a car that was crash tested only by computer simulation? 28