Hardware Reference
In-Depth Information
ldd
sum
; compute array average by dividing array count into
ldx
#ARCNT
; array sum
idiv
;
stx
average
; save the average
bra
$
; stay here forever
array
dc.w
11,12,13,14,15,16,17,18,19,20
dc.w
21,22,23,24,25,26,27,28,29,30
org
$FFFE
; set up reset vector
dc.w
start
end
Figure 3.25 Select language to be supported under CodeWarrior Wizard
The user can open main.asm by double clicking on it and then selecting the whole contents
and replacing them with the previous program.
There are a few things that the user needs to know about when entering a program to be
run by CodeWarrior.
The need to set up reset vector. The reset vector is the address of the first
instruction to be executed after the power is turned on or a reset. The reset vector
must be stored at $FFFE. The following instruction sequence sets up the reset
vector accordingly:
org
$FFFE
dc.w
start
; start is the label of the first instruction of the program
 
Search WWH ::




Custom Search