I am a newbie programmer and using the HCS12 microcontroller.
I am trying to do the following:
1.Calculate the sum of all numbers in an array.place this total in SUM
2.Calculate the sum of all negative numbers in the array.Place this total in NSum.
3.Count the number of occurrances of the number 1 in the array.Place this total in Identical.
I began with the following code, but I do not know how to code step #2
above. Here is the code:
sum: rmb 1
nsum: rmb 1
arcnt: rmb 1
loop: ldaa 0,x
;Is the number negative?
;Count the occurances of the number 1.
array: fcb 1,05,0b,0a,f6,14,ec,1,1e,e2,28,d8,32,ce,1