© 2010 Kettering University, All rights reserved..

Slides:



Advertisements
Similar presentations
© 2010 Kettering University, All rights reserved..
Advertisements

Lecture 5: MIPS Instruction Set
Programming 68HC11.
© 2010 Kettering University, All rights reserved..
ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
© 2010 Kettering University, All rights reserved..
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
EET 2261 Unit 2 HCS12 Architecture
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
Microcontroller Intel 8051
© 2010 Kettering University, All rights reserved..
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
© 2010 Kettering University, All rights reserved..
Addition and Subtraction of Integers
Module 10 Adapted By and Prepared James Tan © 2001.
The 8051 Microcontroller and Embedded Systems
© 2010 Kettering University, All rights reserved..
How Computers Work Dr. John P. Abraham Professor UTPA.
9/20/6Lecture 3 - Instruction Set - Al Instruction Set (2)
The Hexadecimal Number System and Memory Addressing ISAT 121.
Microcomputers I - Electrical and Computer Engineering Dept. at Kettering.
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Lecture Set 4 Programming the 8051.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Addressing Modes MTT CPU08 Core Motorola CPU08 ADDRESSING MODES.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 8.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Lecture 2: Advanced Instructions, Control, and Branching EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
1 4. Computer Maths and Logic 4.1 Number Systems.
1 Microcontroller Fundamentals & Programming Addressing Modes.
© 2010 Kettering University, All rights reserved..
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
Computer Organization Instructions Language of The Computer (MIPS) 2.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
Lecturer: Santokh Singh
Displacement (Indexed) Stack
Instruction sets : Addressing modes and Formats
Morgan Kaufmann Publishers
COMP2121: Microprocessors and Interfacing
Lecture Set 5 The 8051 Instruction Set.
Microcomputer Programming
William Stallings Computer Organization and Architecture 8th Edition
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
The University of Adelaide, School of Computer Science
Introduction to Micro Controllers & Embedded System Design Addressing Mode Department of Electrical & Computer Engineering Missouri University of Science.
MIPS Instruction Encoding
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
MIPS Instruction Encoding
Fields in the FALCON-A Instruction
Introduction to Micro Controllers & Embedded System Design
CNET 315 Microprocessor & Assembly Language
COMS 361 Computer Organization
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
ECE 352 Digital System Fundamentals
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Program Execution.
Presentation transcript:

© 2010 Kettering University, All rights reserved.

Microcomputers I – CE 320 Electrical and Computer Engineering Kettering University Jaerock Kwon, Ph.D.

Announcements The PDF version of lecture slides will have a slide per a page. Upload Exercise 2. To post the lecture slides to the course web page a day earlier.

Lecture 5: Unconditional Branches

Today’s Goals Learn hexadecimal addition and subtraction. Use unconditional branches and jump instructions.

Hexadecimal Addition and Subtraction For the most part, adding and subtracting in hexadecimal is performed like decimal. Only difference is carries or borrows 16 instead of 10. Examples $ $5FD6$AC22 - $1EE8 = $833D = $8D3A

Extending Hexadecimal Numbers When a shorter number is added to or subtracted from a longer number, the shorter number must be extended to the same number of digits as the longer number Unsigned: Signed: $ $D6 $ $6D Always extend by adding 0’s Repeating the sign bits. = Adding ‘F’s or ‘0’s

Truncating Hexadecimal Numbers In microcomputers, it is common practice to represent values using a fewer number of bits to save both time and space. Shortly, we will see the need to represent the value of a two- byte hexadecimal numbers as a one-byte value if possible. UnsignedSigned: $00F5$0045 $10EC$00F5 $FFD1 $FF66 $F280 Remove only leading 0s. The remaining number is always valid. Remove leading 0s and have a positive value or Remove leading Fs and have a negative value.

Relative Addressing (REL) Effective Address: – Add the operand as a signed number to the value in the PC. The effective address is loaded into the PC, and the program executes form the new address Examples – BRA$30 Branch always to the instruction 30h bytes forward. – BRA-10 Branch always to the instruction 10 bytes backwards REL Op Code Relative offset Effective Address Program Counter F

Calculating Branch Destinations ‘Branch’ means changing a value of the program counter in the point of view of the microprocessor. The destination address can be calculated by adding the operand (either + or -0) to the value of the current PC. Valid range: -$80 ~ $7F 20 5E EE XX XX Destination: $2060Destination: $1FF0 Destination: $2085Destination: $1F80 pc Valid destination: $1F82 ~ $2081 if PC is $2002

Branch and Jump BRA – Branch always – Only uses relative addressing (REL) with one-byte operands LBRA – Long Branch always – Only uses relative addressing (REL) with two-byte operands JMP – Jump – Uses extended(EXT) or index addressing (IDX) Instructions

Questions?

Wrap-up Hexadecimal addition and subtraction Unconditional branch instructions What we’ve learned

What to Come Instructions for conditional branches HCS12 Assembly language