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
DAA: Decimal Adjust Accumulator:- This instruction is utilized to convert the result of the addition operation of 2 packed BCD numbers to a valid BCD number. The conclusion has to

AAA: ASCII Adjust after Addition operation the AAA instruction is executed after an ADD instruction that adds 2 ASCII coded operands to give a byte of outcome in the AL. The AAA i

Flag Manipulation and Processor Control Instructions These instructions control the functioning of available hardware inside the processor chip. These are categorized into thes

NEG: Negate:- The negate instruction forms the 2's complement of the particular destination in the instruction. For obtaining 2's complement, it subtracts the contents of destinat

how we can multiply two 8 bit number with rotation

IMUL: Signed Multiplication: This instruction multiplies a signed byte by a signed bit in source operand e in the register AL or signed word in source operand by signed word in th

what is the hex value in ax after executing the instructions ax= 1E8A bx=4080 add al,bl sub ah,bh

I have two homework assignments due in 10 hours for the x86 processor assembly language

I want to do a program as a game by using the Microcontroller 8051 with the assembly language, by using 4*4 keypad and its matrix display. I have to use the keypad for playing the

SEG : Segment of a Label:- The SEG operator is which is used to decide the segment address of the, variable, label or procedure and substitutes the segment base address in plac