Attachment # 00005660 - ECET330_W2_iLab_Procedure.docx
ECET330_W2_iLab_Procedure.docx (156.2 KB)
Raw Preview of Attachment:
(refer to the detailed question and attachment below)
ECET330 Lab2 ProceduresTitle: Introduction to CodeWarriorI. OBJECTIVESTo Install CodeWarriorExplore the CodeWarrior IDE and the operationsBecome familiar with how an assembly language program is entered and simulated using CodeWarriorTo learn how to generate a list fileII. PARTS LISTEquipment:IBM PC or compatible with Windows 2000 or higherCodeWarrior v. 5.1INTRODUCTIONCodeWarrior is a programming environment for Freescale microcontrollers. It is an Integrated Development Environment (IDE), with which you may: (1) write a program, (2) convert into an executable file, (3) simulate in software, or, send it to target processor hardware, (4) send a command to run the program, and (5) test both the program’s final output and intermediate steps. The Debug simulator in CodeWarrior lets us watch a program execute without any microcontroller hardware by using computer (PC) memory to represent the actions of register and memory locations. Professional programmers often do just this in order to locate and remedy bugs in their programs. Simulation can’t, however, help you to detect wrong program actions in your end application. We will postpone running our programs on the HCS12 hardware itself until we become familiar with the CodeWarrior environment. Writing an HCS12 Assembly Language ProgramThe CodeWarrior tutorial in Doc Sharing describes the step-by-step instructions on how to use the CodeWarrior IDE to write a simple assembly language program. In that tutorial, a code skeleton is given. The example below uses that skeleton and adds the line to load five into Register A. XDEF Entry, _Startup ; export 'Entry' symbol ABSENTRY Entry ; Application entry pointRAMStart EQU $2000RAMEnd EQU $3FFFROMStart EQU $8000 ORG RAMStart ; Data definition goes here ORG ROMStartEntry:_Startup: LDAA#$5;************************************************;* Interrupt Vectors *;************************************************ ORG $FFFE DC.W Entry ; Reset Vector Condition Code Register (CCR)The Condition Code Register (CCR) consists of eight bits. The CCR register, as shown by the CodeWarrior window, is shown below. In this lab, we are using C and Z flags.Zero-Flag or Z-flagThe bit associated with the z-flag in the CCR register will become set when the result of an instruction that affects the flag will become zero. For example, when the value of Register B is 1 and we do a DECB instruction, the value of B becomes zero and the z-flag becomes set. The following register window shows this condition.Carry-FlagThe carry-flag will be set when the result of an instruction that affects the given flag will not fit in the destination. For example, let’s assume that the value of A is $FF. The instruction ADDA will add 1 to Register A. The result is $100. Since this result is nine bits, it does not fit in the A register. Thus, A becomes zero and the carry flag becomes set. Note that in this case,the zero flag also becomes set.Note that not all instructions will affect all flag bits. For example, the instruction INCB will add 1 to Register B. This instruction will affect the zero flag but does not change the carry flag. For example, assume that Register B is FF and we do an INCA instruction. The result is shown below. PROCEDUREInstall CodeWarrior v. 5.1. Read the document “How to Install CodeWarrior” in Doc Sharing. Read the CodeWarrior tutorial. This tutorial is in Doc Sharing.Write an assembly language program to load Register A with number 7, and Register B with number 8. Add these two registers.Copy and paste the source code.Single step the lines (as described in the CodeWarrior Tutorial) to load the numbers into Registers A and B.Copy and paste the IDE register window showing the value of A and B.Copy and paste the IDE register window after adding the two numbers. Copy and paste the Assembly Window showing the machine code. The CodeWarrior tutorial describes how to display the machine code in this window.Write an assembly language program to add all of the digits of your D#. Copy and paste the source code.Copy and paste the IDE register window, showing the value of final result (in hex).Copy and paste the IDE register window showing the value of final result (in decimal). Right-clicking on the register window and selecting format -> Dec will show the values in decimal.What are the values of the zero and carry flag after all digits are added?

Homework / Lab

Question # 00068228 Posted By: saabsaab Updated on: 05/11/2015 05:52 PM Due on: 05/17/2015
Subject Computer Science Topic Microprocessor Systems Tutorials:
Question
Dot Image
Complete attached assignments for ECET 330. For Lab use procedure as instructions then use coversheet to answer.
Dot Image
Tutorials for this Question
  1. Tutorial # 00064166 Posted By: neil2103 Posted on: 05/12/2015 12:07 AM
    Puchased By: 3
    Tutorial Preview
    The solution of Homework / Lab...
    Attachments
    ECET330_W2_iLab.docx (76.56 KB)
    HW2.docx (74.89 KB)
Whatsapp Lisa