Hardware Reference
In-Depth Information
Figure 3.24 CodeWarrior project wizard
To enter a program source file into the project, the user can modify the main.asm program
or enter his or her program with a different name and add it to the project. Using the second
approach, the user must remove the main.asm file from the project.
In this section, we use the following assembly program to illustrate the project build and
debug process:
include
“c:\miniide\hcs12.inc”
ARCNT
equ
20
org
$1000
sum
ds.w
1
average
ds.w
1
icnt
ds.b
1
org
$1500
start
movw
#0,sum
movb
#ARCNT,icnt
; initialize loop count
ldx
#array
; use X as a pointer to the array
addloop
ldd
sum
; add array[i] to sum and move pointer
addd
2,x 1
; “
std
sum
; “
dec
icnt
; decrement loop count
bne
addloop
; not done yet?
Search WWH ::




Custom Search