. model small.data
ARRAY dB45H,07H,61H,47H,17H,16H,08H,55H,63H,74H
Even Sum dB ?
Odd Sum dB ?
.CodeSTART:MOVAX, @dataMOVDS,AXMOVDI,00HMOVDI,00HMOVCL,0AH
LABEL:MOVBL, ARRAY [DI]MOVAL,BLRCRAL,1JNC EV
INCDIDECCLJC OD
END LABEL
END
EV:MOVAL,DLMOV Sum,DH
END EV
END
Please help to complete and correct the errors. Thanks in advance
Please try to go through tutorials.
Then try to do your changes on existing code.
After you understand what happens, then try to write your own code. May be also starting from an existing code.
Any reason each sum should only be one byte?
Your allocation of sums look to be in code memory, not RAM. I would think DS is a better definition parameter, and you need to add the size of each sum.
The syntax is also odd, but since we don't know the assembler it's early to say.
The code is not complete. If you could write a small code such that the array of numbers be added separately (i.e odd and even number) and store the even sum in a register and the odd sum in another register.
With respect to the above code, RCR (Rotate to the right with carry) is used to check the least significant bit (0 for even and jump to a sepaarte code EV for addition, whereas for 1 it jump to Odd code OD for sum).