Ask Question
1 January, 22:04

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

+1
Answers (1)
  1. 1 January, 22:12
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers