Title: Assembly MASM code - Finding the sum of odd and even numbers in an array
Text:
Find the sum of odd numbers and even numbers in the following array:
numbers DW 34, 45, 56, 67, 75, 89
HINT:
You can use the instruction "TEST AX, 01" to check if a number is odd or even. If the result is 0, then jump to the label "add_odd" to add the number to the sum of odd numbers. Otherwise, add the number to the sum of even numbers.
{TEST AX, 01
JZ add_odd
add DX, AX}