1 / 5

Intro to CodeWarrior TM

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

eyad
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to CodeWarrior TM Simulating the Microcontroller in Assembly Language FreescaleUniveristy Programs Document Labs12CINTRO03/Rev1

  2. 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

  3. 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

  4. Simulation (cont.) • bne loop ; Loop until B = 0 • nop • ; Forever • bra main_loop

  5. 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

More Related