ECE 265 – LECTURE 7 The M68HC11 Basic Instruction Set Logical, Shift and Rotate, Data Testing 8/14/2015 1 ECE265.

Slides:



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

© 2010 Kettering University, All rights reserved..
EECC250 - Shaaban #1 Lec # 2 Winter Addressing Modes  Addressing modes are concerned with the way data is accessed  Addressing can be.
7-5 Microoperation An elementary operations performed on data stored in registers or in memory. Transfer Arithmetic Logic: perform bit manipulation on.
9/20/6Lecture 3 - Instruction Set - Al Instruction Set.
COMP3221 lec9-logical-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 9: C/Assembler Logical and Shift - I
ARM Microprocessor “MIPS for the Masses”.
EET 2261 Unit 5 Tables; Decision Trees & Logic Instructions
Revised: Aug 1, EE4390 Microprocessors Lesson 6,7 Instruction Set, Branch Instructions, Assembler Directives.
HCS12 Arithmetic Lecture HC12 Arithmetic Addition and Subtraction Shift and Rotate Instructions Multiplication Division.
Addressing Modes & Instruction Set By: Prof. Mahendra B. Salunke Asst. Prof., Department of Computer Engg., SITS, Pune-41 URL:
Logical, Shift, and Rotate Operations CS208. Logical, Shift and Rotate Operations  A particular bit, or set of bits, within the byte can be set to 1.
Logical and Shift operations A particular bit, or set of bits, within the byte is set to 1 or 0 depending on conditions encountered during the execution.
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Chapter 3.
Microcontroller Fundamentals & Programming
ARM Instructions I Prof. Taeweon Suh Computer Science Education Korea University.
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
MICROCONTROLLER INSTRUCTION SET
The M68HC11 Basic Instruction Set Basic Arithmetic Instructions
MC68HC11 Instruction Set.
Chapter 2: 68HC11 Assembly Programming
H. Huang Transparency No.2-1 The 68HC11 Microcontroller Chapter 2: 68HC11 Assembly Programming The 68HC11 Microcontroller.
9/20/6Lecture 3 - Instruction Set - Al Instruction Set (2)
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
ICS312 Set 9 Logic & Shift Instructions. Logic & Shift Instructions Logic and Shift Instructions can be used to change the bit values in an operand. The.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
BITWISE OPERATIONS – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
ECE 447: Lecture 12 Logic, Arithmetic, Data Test and Control Instructions of MC68HC11.
ECE 265 – LECTURE 3 68HC11 Address Space, Memory, Registers, and data transfers 3/29/ ECE265.
3-1 EE 319K Introduction to Microcontrollers Lecture 3: Addressing modes, Memory Operations, Subroutines, I/O, Logical/Shift Operations.
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
Assembly 05. Outline Bit mapping Boolean logic (review) Bitwise logic Bit masking Bit shifting Lookup table 1.
ELE22MIC Lectures 6 and 7 Assembly Language Instruction Set Overview, Part 3 –Addressing Modes –Add, Push, Pull, Jump –Conditional Jumps.
Logical and Bit Operations Chapter 9 S. Dandamudi.
Advanced Assembly Language Programming
CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS.
Arithmetic and Logic Chapter 5
COMP3221: Microprocessors and Embedded Systems--Lecture 10 1 COMP3221: Microprocessors and Embedded Systems Lecture 10: Shift and Bit-set Instructions.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
Embedded Systems Lecture 5 January 25 th, 2016.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
Logical, Shift, Rotate & BCD. What we will learn in this session: Logical instructions. Shift & Rotate instructions. BCD operations. Bit operations.
The 68HC11 Microcontroller Minnesota State University, Mankato
HC11 Programming.
Assembly Language Programming of 8085
ECE 3430 – Intro to Microcomputer Systems
ECE 3430 – Intro to Microcomputer Systems
Processor Instructions set. Learning Objectives
Overview Register Transfer Language Register Transfer
Overview Introduction General Register Organization Stack Organization
Arithmetic and Logic Chapter 5
68000 Arithmetic Instructions
The 8051 Assembly Language Arithmetic & Logic Instructions
Lecture 5 from (Chapter 4, pages 73 to 96)
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
CS-401 Computer Architecture & Assembly Language Programming
Logical Operations In some applications it is necessary to manipulate other sizes of data, or perhaps only individual bits. There are instructions that.
Logical Operations bitwise logical operations AND, OR, EOR, NOT
Shift & Rotate Instructions)
The University of Adelaide, School of Computer Science
Chapter 4: Representing instructions
Logical Operations ANL / ORL
Arithmetic and Logic Chapter 5
The ARM Instruction Set
Branching instructions
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS
Immediate data Immediate operands : ADD r3, r3, #1 valid ADD r3, #1,#2 invalid ADD #3, r1,r2 invalid ADD r3, r2, #&FF ( to represent hexadecimal immediate.
Shift and Rotate Instructions.
Presentation transcript:

ECE 265 – LECTURE 7 The M68HC11 Basic Instruction Set Logical, Shift and Rotate, Data Testing 8/14/ ECE265

Lecture Overview  The M68HC11 Basic Instruction Set  The Logical instructions to perform Boolean operations  The Data Testing  The Shift and Rotate instructions  REF: Chapter 3 and the appendix that details the instructions. 8/14/ ECE265

The Logical Instructions  Instructions to perform Boolean operations on data  Instructions for AND NOT and OR operation 8/14/2015ECE265 3

AND operation  Description: AND the A (or B) accumulator with the operand of the instruction  CC effects: N Z set per result  Forms: ANDA (opr) ANDB(opr)  And can be immediate mode or a memory location  ANDA #$FF What does this do?  ANDB #$00 What does this do? 8/14/2015ECE265 4

AND operation and masking  Masking is keeping only those bits you are interested in. The reaming bits are “masked” out.  Example  ANDA #$0F Keep the lower 4 bits of accum A  If the A accumulator contains a value of $34  Then this operation is A  AND-ed with  giving /14/2015ECE265 5

OR operation  Description: OR the A (or B) accumulator with the operand of the instruction  CC effects: N Z set per result  Forms: ORA (opr) ORB(opr)  And can be immediate mode or a memory location  ORAA #$FF What does this do?  ORAB #$00 What does this do? 8/14/2015ECE265 6

Exclusive OR operation  Description: Exclusive OR the A (or B) accumulator with the operand of the instruction  CC effects: N Z set per result  Forms: EORA (opr) EORB(opr)  And can be immediate mode or a memory location  EORA #$FF What does this do?  EORB #$00 What does this do? 8/14/2015ECE265 7

The NOT or invert operation  Description: Can complement a complete byte in an accumulator or memory. This is a bitwise complement.  CC effect: N V set per data, V cleared, C set  Forms: COMA COMB COM (opr) 8/14/2015ECE265 8

Examples  Example instructions Accum A has val $1C Memory $D330 val $2F  (a) ANDA $D330  (b) EORA $D330  (c) ORAA $D330 8/14/2015ECE265 9

Data Testing Instructions  Will cover the Bit Test and Setting and Clearing of bits.  The branch will be covered with branches. 8/14/2015ECE265 10

Bit test  Description: Compare the operand with the accumulator contents and set the CC bits. Performs a bitwise logical AND.  CC effects: N Z eval V cleared  Forms: BITA (opr) BITB (opr)  If operand is equal to accumulator Z is set  See Appendix A of text for a complete description 8/14/2015ECE265 11

Clear and set bits in memory  Description: Set or Clear bits in memory according to a mask given in the instruciton.  CC effects: N Z V cleared  Forms: BSET (opr) (mask) BCLR (opr) (mask)  Example BSET $0035 $09  Performs a logical OR of the contents of location $35  With $09 and puts the result back in the location.  This example will set bits 0 and 3 of the data byte. 8/14/2015ECE265 12

Shift and Rotate Instructions  The instructions perform arithmetic and logical shifts and also rotate the data. 8/14/2015ECE265 13

The effect of shift and rotates  What do the instructions do? 8/14/2015ECE265 14

What is the real effect of  Arithmetic shifts?  Do arithmetic shifts have the effect of multiplicaiton?  Unique aspects of logical shifts  Can also do double shifts 8/14/2015ECE265 15

The instructions  Arithmetic Shifts  ASL (opr) ASLA ASLB ASLD  ASR (opr) ASRA ASRB  Logical Shifts  LSL (opr) LSLA LSLB LSLD  LSR (opr) LSRA LSRB LSRD  Rotates  ROL (opr) ROR (opr)  ROLA ROLB RORA RORB  There is no rotate of D 8/14/2015ECE265 16

Example of use  Interesting data manipulation 8/14/2015ECE265 17

Example of use  Exchange the upper and lower nibbles of a byte in memory. 8/14/2015ECE265 18

Lecture summary 8/14/2015ECE  Have covered  The Logical instructions to perform Boolean operations  The Data Testing  The Shift and Rotate instructions

Assignment 8/14/2015ECE  Problems Chapter 3 page 87  Problem 19  Problem 21