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
i have a question.

Queue Operation :   RQ/CT0, RQ/G1-Request/Grant:   These pins are utilized by other local bus masters, in themaximum mode, to force the processor to release the loca

code, Assembly Language How to print strings in Right Triangle form?

You have to write a subroutine (assembly language code using NASM) for the following equation.

A good starting point for your program is the toupper.asm program shown in class. It already queries the user for input and sets up a loop that looks at each character of the input

Trying to convert small programs from C to 8086 assembly language using emu 8086 emulator. I converted to low level C, but struggling with converting to the Assembly language.

Hand shaking : Handshaking, or 2-way handshaking, is 1 type of strobe operation. It typically involves 2 handshaking lines: an output line to denote when the board is ready an

As an instance of the normal priority mode, imagine that initially AEOI is equal to 0 and all the ISR and IMR bits are clear. Also consider that, as shown in given figure, requests

write an assembly language program to find average of odd numbers from an array of 8 bit numbers

I need some guidance on which project to make in assembly language