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?


Offered Price $70.00

Homework / Lab

Question # 00068228
Subject: Computer Science
Due on: 05/17/2015
Posted On: 05/11/2015 05:52 PM
Expert tutors with experiences and qualities
Posted By
Best Tutors for school students, college students
Feedback Score:

Purchase it
Report this Question as Inappropriate
Complete attached assignments for ECET 330. For Lab use procedure as instructions then use coversheet to answer.

Tutorials for this Question

Available for

Homework / Lab

Tutorial # 00064166
Posted On: 05/12/2015 12:07 AM
Posted By:
Best Tutors for school students, college students neil2103
Expert tutors with experiences and qualities
Feedback Score:
Report this Tutorial as Inappropriate
Tutorial Preview …/…
ECET330_W2_iLab.docx (76.56 KB)
Preview: RAMStart x Data xxxxxxxxxx goes here xxx ROMStartEntry:_Startup: LDAA#$7 xxxx #$8 xxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Interrupt xxxxxxx *;************************************************ ORG xxxxx DC W xxxxx ; xxxxx xxxxxx IV xxx Copy and xxxxx the IDE xxxxxxxx window xxxxxxx xxx value xx A and x IV 1-C xxxx and xxxxx xxx IDE xxxxxxxx window showing xxx value of x and x xxxxx executing xxx instruction to xxx A and x $7 x xx = xxxx 1 D x Copy and xxxxx the xxxxxxxx xxxxxx showing xxx machine code xx 2 A xxxx and xxxxx xxx source xxxx for adding xxxx ID numbers xxxx Entry, xxxxxxxx x export xxxxxxx symbol ABSENTRY xxxxx ; Application xxxxx point xxxxxxxx xxx $2000RAMEnd xxx $3FFFROMStart.....
HW2.docx (74.89 KB)
Preview: 1 xxxxxxxx :Write x simple program xx which the xxxxxx $55, xx xxxxx three xxxxx Student Answer:LDAA xxxx ADDA #$55 xxxx #$55 xxxx xxxx Instructor xxxxxxxxxxxxxxxx #$00ADDA #$55ADDA xxxxxxxx #$55Points Received:(not xxxxxxx Comments:Question x xxxxxxxx :Which xx the following xxxxxxxxxxxx is (are) xxxxxxxxx LDAA xxxxxx xxxx #50III xxxx #$255IV STAA.....
Purchase this Tutorial @ $90.00 *
* - Additional Paypal / Transaction Handling Fee (3.9% of Tutorial price + $0.30) applicable