Intro to codewarrior tm
This presentation is the property of its rightful owner.
Sponsored Links
1 / 5

Intro to CodeWarrior TM PowerPoint PPT Presentation


  • 110 Views
  • Uploaded on
  • Presentation posted in: General

Intro to CodeWarrior TM. Simulating the Microcontroller in Assembly Language Freescale Univeristy Programs Document Labs12CINTRO03/Rev1. Simulation Program. ; Your program code goes here ; Initialize I/O main_loop : ; DO nop ; A "no operation" operation

Download Presentation

Intro to CodeWarrior TM

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Intro to codewarrior tm

Intro to CodeWarrior TM

Simulating the Microcontroller in Assembly Language

FreescaleUniveristy Programs

Document Labs12CINTRO03/Rev1


Simulation program

Simulation Program

  • ; Your program code goes here

  • ; Initialize I/O

  • main_loop:

  • ; DO

  • nop ; A "no operation" operation

  • ldx#ConstData ; Initialize X with an address

  • ldab#$02 ; Initialize a counter with data


Simulation cont

Simulation (cont.)

  • ; Load and store data in a loop

  • loop:

  • ldaa0,x ; Get the data

  • staaVarData; Store it in RAM

  • ldaa2,x ; Get another byte

  • staaVarData+1 ; Store it

  • Inx ; Increment the pointer

  • decb ; Decrement the counter


Simulation cont1

Simulation (cont.)

  • bne loop ; Loop until B = 0

  • nop

  • ; Forever

  • bra main_loop


Simulation cont2

Simulation (cont.)

  • ;***************************************MyConst:SECTION

  • ; Place constant data here

  • ConstData: DC.B $0a,$0b,$11,10

  • ;***************************************

  • MyData: SECTION

  • ; Place variable data here

  • VarData: DS.B 2 ; Two bytes of storage


  • Login