write a program that coutns the number of elements in an array that are even num
ID: 3581100 • Letter: W
Question
write a program that coutns the number of elements in an array that are even number, the array has 11 elements, each 16 bit and is stored in memory location starting from $800 (higher byte at $800, lower byte at $801). your code should start from $C000. include algorithm and flowchart with your code, (the language shoud be assembly language so it could be used on motorola 68hc11
)
for tele PIC ccrtraler, pL21proxil mel, intna all ilil lin Volase: cara alit has fumang rt22 al, ind IIR1VN.IN: can a lRT han ruin- 2aramctars sa. Infrv nt init alized). Ke _ Fr>>CH tenalasin, K ,zaarsl Gain, Ka-Cunvative gain, and fip-set rcirt. Tha w.wy pID Cortrollsa works is. it cad: ?" tpcess varabe)full; the illa t, enl r culstes ET(ci f,r-Pv-SYS tTor lues are stered in me-rry. Tined cn this erl reculates ET iCir. py-W) tTor celues TOIt :: dittererC2 tet.ccn la arc ca, t I a, salilHN, i.k, t:-1 1-E-11, Than, pLQ O.r; value to tne output, sertedlow:hart."D"chi: F:D Ccrtclk" [HInt: you might want to nrtte ocperc tn t her 5-G c cesu t to understand how/tworks, arc chen rt n1trg tne r cv-chartExplanation / Answer
Solution :
Step 1:memory is loaded with the location at $800 into accumulator A.
Step 2:The contents of the memory location is at $801 into accumulator A.
Step 3: the contents of the memory location is added at $802 into accumulator A.
Step 4: the contents of accumulator A stored at memory location $900.
These steps can be translated into the as12 assembly program as follows:
Start of the program
org $1000 ;
ldaa $800 ; the contents is placed at memory location $800 into A
adda $801 ;
adda $802 ;
staa $900 ;
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.