Odd and even numbers, Assembly Language

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. please help me? how do you make the odd and even numbers in assembly language?
Posted Date: 10/1/2012 6:44:39 AM | Location : United States





.model small

.data
arr1 db 1,2,3,1,3,5,6,3,4,5
OddArr db 10 dup(?)
EvenArr db 10 dup(?)
OddAdd db 0
EvenAdd db 0

.code
mov ax,@data
mov ds,ax

LEA BX,arr1
LEA SI,OddArr
LEA DI,EvenArr
mov cx,10
mov dh,02

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 EvenAdd,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
Posted by diana | Posted Date: 10/1/2012 7:15:03 AM


Related Discussions:- Odd and even numbers, Assignment Help, Ask Question on Odd and even numbers, Get Answer, Expert's Help, Odd and even numbers Discussions

Write discussion on Odd and even numbers
Your posts are moderated
Related Questions
SHORT  : The  SHORT operator denoted to the assembler that only one byte is needed to code the displacement for a jump (for example displacement is within -128 to +127 bytes fr

Memory Mapped I/O Memory I/O devices are mapped into the system memory map with ROM and RAM. To access a hardware  device, simply write or  read  to  those  'special'  addresse

Write an 8086 program to find out the number of positive numbers and negative numbers from a given series of signed numbers include flow chart ..

DIV: Unsigned Division:- This instruction performs unsigned division operation. It divides an unsigned word or double word by a 16-bit or 8-bit operand. The dividend might be in t

Flag Register : 8086 has a 16-bit flag register which is divided into 2 parts, viz. (a)machine control flagsand (b)condition code or status flags. The condition code flag regi

Interrupt System Based on Single 8259 A The 8259A is contained in a 28-pin dual-in-line package that need only a + 5-V supply voltage.  Its organization is shown in given figur

need some project ideas

Write a MIPS/SPIM assembly language program that prints the smallest and largest values found in a non-empty table of N word-sized integers. The address of the first entry in your

write a program assembly language for adding two 3*3 matrix

#question. counters using 8051.