Upload
jose-smith
View
220
Download
0
Embed Size (px)
Citation preview
8/13/2019 CodeWarrior ASM Tutorial
1/6
CodeWarrior for HCS12 Assembly ProgrammingUpdated 08-17-10 by: M. Mazidi with contribution from Danny Causey and ra!is Chand"er
1# $tart Code%arrior for &C$1' and c"ic( Crate )ew *ro+ect shown be"ow.
,,f Code%arrior is a"ready runnin you may se"ect new pro+ect from the fi"e menu or c"ic( the icon onthe too" bar.
8/13/2019 CodeWarrior ASM Tutorial
2/6
'# $e"ect the MCU to proram and your connections. /ou can chane your connection at any time aftercreatin a pro+ect for now we choose fu"" chip simu"ation. C"ic( )et.
2# $et the "ocation where the pro+ect is to be sa!ed and name the pro+ect as shown be"ow. Choose the"anuae3s# you wi"" be usin. Unse"ect the 45e"ocatab"e assemb"y6 then se"ect 4bso"ute assemb"y6. C"ic()et.
8/13/2019 CodeWarrior ASM Tutorial
3/6
# Choose any fi"es your pro+ect wi"" use for this eamp"e we do not need any additiona" fi"es. C"ic( )et.,,/ou can a"so add fi"es to your pro+ect after it has been created.
9# Choose )one; for 5apid pp"ication De!e"opment. C"ic(
8/13/2019 CodeWarrior ASM Tutorial
4/6
=# >pand the $ources fo"der created by Code%arrior and doub"e c"ic( main.asm as shown be"ow.
7# 5ep"ace the temp"ate code pro!ided by Code%arrior with an eamp"e from the boo( as shown be"ow oryour own code. )ote that the minima" re?uirements for an ssemb"y proram are the fo""owin:
a# the @$>)5/ >ntry dec"aration at the top.
b# the inc"ude fi"e that defines the reisters of the MCUc# the A5B dec"aration abo!e the >ntry "abe" andd# the A5B
8/13/2019 CodeWarrior ASM Tutorial
5/6
If this is confusing, you can delete everything in the main.asm program in the CodeWarrior. Then go to
the www.MicroDigitalEd.comweb site and under C!"# boo$ clic$ on %Dragon"# !ample &rograms
and !upport'. (ou will see sample programs in both )ssembly and C for Dragon"# plus Trainer board.
In the )ssembly program section Clic$ on %Toggling *EDs on &+T-'. Copy the program and paste it
into the main.asm program.
8#
8/13/2019 CodeWarrior ASM Tutorial
6/6
"/ Compiling, Downloading and E0ecuting a proram for Draon1' *"us rainer board 3or any trainerboard#. )ow c"ose the rue-ime $imu"ation window. De"ete e!erythin in the main.asm proram in theCode%arrior. Bo to the www.MicroDiita">d.comweb site and under &C$1' boo( c"ic( on 4Draon1'$amp"e *rorams and $upport6. /ou wi"" see samp"e prorams in both ssemb"y and C for Draon1' p"usrainer board. n the ssemb"y proram section C"ic( on 4o"in F>Ds on *A5@6. Copy the proram andpaste it into the main.asm proram
11# n the drop-down where it shows