© 2010 Kettering University, All rights reserved..

Slides:



Advertisements
Similar presentations
Instruction formats for the PIC series. ROM encoding Instructions are encoded in binary in ROM. The instructions are fixed format, each occupying 14 bits.
Advertisements

© 2010 Kettering University, All rights reserved..
Floyd, Digital Fundamentals, 10 th ed EET 2261 Unit 7 Indexed Addressing Mode Read Mazidi, Chapter 6. Homework #7 and Lab #7 due next week. Quiz next week.
Computer Architecture
Computer Structure.
© 2010 Kettering University, All rights reserved..
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Block Diagram of Intel 8086 Engr.M.Zakir Shaikh
Registers of the 8086/ /2002 JNM.
Microprocessors.
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
EET 2261 Unit 5 Tables; Decision Trees & Logic Instructions
Revised: Aug 1, EE4390 Microprocessors Lesson 6,7 Instruction Set, Branch Instructions, Assembler Directives.
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
EET 2261 Unit 2 HCS12 Architecture
© 2010 Kettering University, All rights reserved..
Microcontroller Fundamentals & Programming
ECE 265 – LECTURE 7 The M68HC11 Basic Instruction Set Logical, Shift and Rotate, Data Testing 8/14/ ECE265.
© 2010 Kettering University, All rights reserved..
SUPERSCALAR EXECUTION. two-way superscalar The DLW-2 has two ALUs, so it’s able to execute two arithmetic instructions in parallel (hence the term two-way.
Assembly Language Programming for the MC68HC11. Assembly language programming  Recall the 4 design levels for software development: – Application – High.
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
© 2010 Kettering University, All rights reserved..
© 2010 Kettering University, All rights reserved..
D75P 34 – HNC Computer Architecture Lecture 14 Clock Cycles and Program Analysis. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.
Vintage Computer Hardware 101 Featuring the MITS Altair 680b Bill Degnan.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
© 2010 Kettering University, All rights reserved..
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
© 2010 Kettering University, All rights reserved..
ECE 447: Lecture 12 Logic, Arithmetic, Data Test and Control Instructions of MC68HC11.
CHAPTER-2 Fundamentals of Digital Logic. Digital Logic Digital electronic circuits are used to build computer hardware as well as other products (digital.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
3-1 EE 319K Introduction to Microcontrollers Lecture 3: Addressing modes, Memory Operations, Subroutines, I/O, Logical/Shift Operations.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Ass Prof Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 6: Control Instructions.
The Central Processing Unit (CPU)
Advanced Assembly Language Programming
© 2010 Kettering University, All rights reserved..
Lec. 10 Assembly Programming Dr. Tamer Samy Gaafar Microprocessors.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
EE345 Chapter 2 Lecture 3 April 4. Quiz every Wednesday 1 quiz = 1% extra credit five quizzes before midterm  5% for midterm. five quizzes before final.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
Unit 1 Instruction set M.Brindha AP/EIE
ECE 3430 – Intro to Microcomputer Systems
Addressing Modes in Microprocessors
HC11 Programming.
Microprocessor T. Y. B. Sc..
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Introduction to microprocessor (Continued) Unit 1 Lecture 2
ECE 3430 – Intro to Microcomputer Systems
Lecture on Microcomputer
ECE 3430 – Intro to Microcomputer Systems
THE CPU i Bytes 1.1.
Introduction of microprocessor
Microcomputer Programming
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ECE 3430 – Intro to Microcomputer Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Central Processing Unit
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Indexing Through Memory
Register sets The register section/array consists completely of circuitry used to temporarily store data or program codes until they are sent to the.
Presentation transcript:

© 2010 Kettering University, All rights reserved.

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

Announcements Quiz 3 on Monday 30 mins to fill out addresses and contents in a listing file. Exercise 3 will be greatly helpful.

Lecture 12 : Boolean Logic Instructions

Todays Goals Learn how to use Boolean instructions in assembly code

Logical Instructions One of the main purposes of the logical instructions is to affect individual bits of a byte without affecting the others. Target and Mask byte Target byte with the data Mask byte which determines which bits are affected. Format [logical instruction][register or memory] [mask byte] Ex. ANDA #% Function0 Mask Bit1 Mask Bit ANDClear to 0No affect ORNo affectSet to 1 XORNo affectToggle

AND ANDA and ANDB affect N and Z clear V no affect on C Example Determine if the number in location $1000 is evenly divisible by 8. LDAA$1000 ANDA#% ; or #$07 ; If the Branch is taken, the number is divisible BEQxxx ANDA and ANDB

OR, XOR, and NOT ORAA, ORAB affect N and Z clear V no affect on C EORA, EORB(meaning XOR) affect N and Z clear V no affect on C COMA, COMB, COM (meaning NOT) All eight bits are complemented. A mask byte is not used. (right?) affect N, Z clear V set C to 1

Example Consider a two-door sports car with a trunk and a glove box. Assume that contact switches are used to monitor each door and send signals to the processor indicating whether the door is open (TRUE) or closed (FALSE) Four bits are need to monitor two side doors, a trunk, and a glove box. The four bits will be 7, 6, 5, and 4 of memory $0000. Microprocessor can read the contents of this location at any time to read the status of the doors. Also the microprocessor maintains a bit for the cabin light, the trunk light, and the glove box light. Storing a 0 in the bit causes the light to be OFF Storing a 1 makes the light ON. These three bits will be 2, 1, and 0 of the location $1000 respectively $0000GBOXDLEFTDRGHTDTRNKD-GBOXLCBNLTRNKL

Example Turn OFF Use AND with a proper mask byte Turn off the glove box light without affecting the other bits. LDAA$00 ANDA#% STAA$ $0000GBOXDLEFTDRGHTDTRNKD-GBOXLCBNLTRNKL

Example Turn ON Use OR with a proper mask byte Turn on the trunk light without affecting the other bits. LDAA$00 ORA#% STAA$ $0000GBOXDLEFTDRGHTDTRNKD-GBOXLCBNLTRNKL

Example Turn ON Use OR with a proper mask byte Turn on the glove box light and the cabin light without affecting the other bits. LDAA$00 ORA#% STAA$ $0000GBOXDLEFTDRGHTDTRNKD-GBOXLCBNLTRNKL

Example Toggle Use XOR with a proper mask byte Toggle the cabin light without affecting the other bits. LDAA$00 EORA#% STAA$ $0000GBOXDLEFTDRGHTDTRNKD-GBOXLCBNLTRNKL

Example Negate accumulator D COMA COMB ADD#1 Negate D without using the logical complement functions EORA #% ; #$FF EORB#% ; #$FF ADDD#1 Negate accumulator D

Example 1KHz 1000 times / sec Clock speed of Dragon12+: 24 MHz (24,000,000 Hz) means 24 million clock cycles / sec When the sum of all cycles of the lines become 24,000, we can say the module runs 1,000 times per second N + 3(N-1) = 24, N = 24,000 then, 4N = Therefore, N = N should be an integer, so 4N ? = 24,000 If 5 is used for ?, then N = 5996 Toggle the cabin lights at exactly 1000 Hz flip: LDAA $00; 3 EORA#CBNL; 2 STAA $00; 3 LDX #N; 2 loop: DEX; N BNE loop; 3(N-1)+1 BRA flip; 3

Example - continued Toggle the cabin lights at exactly 1,000 Hz flip: LDAA $00; 3 EORA#CBNL; 2 NOP; 1 NOP; 1 (to add 5 extra clock cycles) BRA0; 3 (use 3 clock cycles while do nothing) STAA $00; 3 LDX #5996; 2 loop: DEX; 5996 BNE loop; 3(5996-1)+1 BRA flip; 3

A Short Story about K and M in bytes In general, K means 1,000 M means 1,000,000 When you count bytes, K means 1,024 M means 1,024 x 1,024 1,024 comes from 2 10 = 1,024 Remember 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, …

Questions?

Wrap-up Boolean logical instructions ANDx, ORAx, EORx, and COMx What weve learned

What to Come Bit instructions Stack Subroutines