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
III rd Generation Microprocessor: The single 3rd generation microprocessor chip having 64-pins began with the introduction of 16-bit Intel 8086 in 1978. The other essential

CAN U GIVE BRIEF THEORY

#question. counters using 8051.

code to add two matrices

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

Write a M68000 assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n

RET : Return from the Procedure:- At each CALL instruction, the register IP and register CS of the next instruction is pushed to stack, before the control is transferred to the

Cache Memory Caching is a technology based on the memory subsystem of any computer. The majoraim of a cache is to accelerate the computer while keeping the cost of the computer

Hello, I just want to know how much would it cost for you to develop , debug and test a program in matlab to solve a system of equations with gauss elimination with partial pivotin

write an assembly language program that has two subroutines : one for encrypting alphabates of a string and second fo decrypting the encoded string . in encryption simply converta