MICRO-CONTROLLER MOTOROLA HCS12 Running assembly code Mechatronics Department Faculty of Engineering Ain Shams Univeristy.

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
SPIM and MIPS programming
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Chih-Hung Wang Chapter 2: Assembler (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley, 1997.
Assemblers Dr. Monther Aldwairi 10/21/20071Dr. Monther Aldwairi.
Railway Foundation Electronic, Electrical and Processor Engineering.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Railway Foundation Electronic, Electrical and Processor Engineering.
MICRO-CONTROLLER MOTOROLA HCS12 Instruction Set Mechatronics Department Faculty of Engineering Ain Shams Univeristy.
ARM Core Architecture. Common ARM Cortex Core In the case of ARM-based microcontrollers a company named ARM Holdings designs the core and licenses it.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
ECE 265 – LECTURE 9 PROGRAM DESIGN 8/12/ ECE265.
MICRO-CONTROLLER MOTOROLA HCS12 Addressing Modes Mechatronics Department Faculty of Engineering Ain Shams Univeristy.
Lecture 6 Assembler Directives. 2  Code generation flow  Assembler directives—Introduction  Segment control  Generic segment (SEGMENT, RSEG)  Absolute.
CEG 320/520: Computer Organization and Assembly Language Programming1 Assembly Language Programming Assembler Directives and The Symbol Table.
1/1/ /e/e eindhoven university of technology Practical exercises 5JJ20/2M200: Introduction to the assembler Dr.ir. Ad Verschueren.
Writing an Assembly-language program Atmel assembly language CS-280 Dr. Mark L. Hornick 1.
EE 362 Microprocessor Systems and Interfacing © 2-1 Laboratory 2.1 Part 1: Assembler Directives Procedure:  Create a directory called H:\cx\source\ee362\lec02\L02LabAld.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Assembly Language Programming for the MC68HC11. Assembly language programming  Recall the 4 design levels for software development: – Application – High.
P.1ECE 331, Prof. A. Mason Professor Andrew Mason Michigan State University Spring 2013 ECE 331: PC Lab 1: Using HC12 ASM Simulators.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 7: Assembly Language.
A Simple Two-Pass Assembler
CoE3DJ4 Digital Systems Design
Debug and Assembler By, B.R.Chandavarkar Lect. COMP Department NITK, Surathkal.
Assemblers.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
Ass. Prof. Dr Masri Ayob TK 6123 Lecture 13: Assembly Language Level (Level 4)
PIC – ch. 2c. 2.5 PIC Data formats Numbers can be – Hex – Binary – Decimal – ASCII formats.
9/20/6Lecture 2 - Prog Model Architecture, Data Types and Addressing Modes.
1 Segments and Pseudo Operations Program Development.
Machine Independent Assembler Features
MICROOCESSORS AND MICROCONTROLLER:
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
G.Umamaheswari Lect/IT R.M.D.EC system software
Microprocessors used in Personal Computers. The Memory Map of a Personal Computers Transient Program Area (TPA): Holds the operating system (interrupt.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
1 EKT 225 MICROCONTROLLER I CHAPTER ASSEMBLY LANGUAGE PROGRAMMING.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
CS501 Advanced Computer Architecture Lecture 29 Dr.Noor Muhammad Sheikh.
Assembler Directives Code generation flow
Addressing Modes in Microprocessors
Machine Independent Assembler Features
Assembly Language (continue)
Gunjeet Kaur Dronacharya Group of institutions
Symbol Definition—CODE, DATA, IDATA, XDATA
The 8051 Microcontroller and Embedded Systems
Assembler Directives Code generation flow
Machine Independent Assembler Features
Microprocessor and Assembly Language
L7 – Assembler Directives
CS 301 Fall 2001 – Chapter 3 Slides by Prof. Hartman, following “IBM PC Assembly Language Programming” by Peter Abel 9/17/2018.
Lecture 6 Assembler Directives.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Computer Organization & Compilation Process
COMP2121: Microprocessors and Interfacing
68000 Architecture, Data Types and Addressing Modes
Introduction to Micro Controllers & Embedded System Design
A Simple Two-Pass Assembler
System Programming by Leland L. Beck Chapter 2
8051 ASSEMBLY LANGUAGE PROGRAMMING
Assembler Directives end label end of program, label is entry point
Program Pass I LC Symbol Table Pass II Machine Code ORG $400
By Nasser Halasa Assembly Language.
WJEC GCSE Computer Science
Location Counter (LC) = 0 while line of code <> END if ORG
Presentation transcript:

MICRO-CONTROLLER MOTOROLA HCS12 Running assembly code Mechatronics Department Faculty of Engineering Ain Shams Univeristy

Assembly Directives Commands to the assembler Commands to the assembler Not executable by the microprocessor Not executable by the microprocessor Are not converted to machine codes Are not converted to machine codes Define program constants and reserve space for dynamic variable Define program constants and reserve space for dynamic variable Specifies the end of a program. Specifies the end of a program.

Org (origin) org$1000 ldab#$FF;this instruction will be stored in memory starting from location $1000.  Tells the assembler where to place the next instruction/data in memoryExample:

equ (equate) loop_countequ50;.” “Informs the assembler whenever the symbol loop_count is encountered, it should be replaced with the value 50.”  Assigns a value to a label.  Makes programs more readable.Example:

dc.b (define constant byte) org$800 arraydc.b $11,$22,$33,$44  Define the value of a byte or bytes that will be placed at a given location.Example:

dc.w (define constant word) org$800 arraydc.w $AC11,$F122,$33,$F44  Define the value of a word or words that will be placed at a given location.Example:

ds (define storage) bufferds100;reserves 100 bytes starting from the location represented by buffer - none of these locations is initialized  Reserves a number of bytes for later use.Example:

ds.w (define storage word) Dbufds.w 20;Reserves 20 words (or 40 bytes) starting from the current location counter.  Reserves a number of words for later use.Example:

MC68HC12 “Stepper Motor Control” Port T 3|2|1|0$242

MC68HC12 “Stepper Motor Control” size equ4; PTTequ$240;Address of port T DDRTequ$242;Data direction register for port T steps:dc.b5,10,9,6 org$ Entry:movb#$FF, DDRT;Set port T wfor output run:ldaa#size;initialize counter in A ldx#steps;Point to the steps in memory step:movb1, x+, PTT;step the motor dbneA, step;Decrement A and check if it’s zero brarun;Always run steps0101 steps steps steps

Eng. Mohamed Mahmoud Hamdy Eng. Mostafa Ahmed Arafa Prepared by: