Ask Question
6 April, 16:33

Write an ALP to separate odd and even numbers from an array of N numbers; arrange odd

numbers in address 2000h, even numbers in address 3000h using 8086

+2
Answers (1)
  1. 6 April, 17:07
    0
    Below is the program to separate odd and even numbers

    Explanation:

    L1:

    mov ah, 00

    mov al,[BX]

    mov dl, al

    div dh

    cmp ah, 00

    je EVEN1

    mov [DI], dl

    add OddAdd, dl

    INC DI

    INC BX

    Loop L1

    jmp CAL

    EVEN1:

    mov [SI], dl

    add Even Add, dl

    INC SI

    INC BX

    Loop L1

    CAL:

    mov ax, 0000

    mov bx, 0000

    mov al, OddAdd

    mov bl, EvenAdd

    MOV ax, 4C00h

    int 21h

    end

    The above program separates odd and even numbers from the array using 8086 microprocessor. It has odd numbers in 2000h and even numbers in 3000h.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write an ALP to separate odd and even numbers from an array of N numbers; arrange odd numbers in address 2000h, even numbers in address ...” in 📘 Engineering if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers