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
Write the structure of For…Next loop in VB.Net and also write a program to print integers from 1 to 10 on the console.

SUB: Subtract :- The subtract instruction subtracts the source operand from destination operand and result is left in the destination operand. Source operand might be memory locati

Write an Lc-3 assembly language program to read in a sequence of single-digit positive integers from the keyboard(one integer per line) until the sentinel value of 0 is reached and


1. Write a program that will generate an array of ten random 32-bit integers, and that will  display on the monitor the numbers followed by either the words " has the fourth bit se

Intel's 8237 DMA controller : 1) The 8237 contain 4 independent I/O channels 2) It contains 27 registers, 7 of which are system-wide registers and 5 for each channel. 3)

Write a program that allows a user to encrypt/decrypt a message using a shift cipher. The user should specify the key and the message. Your program should be able to handle messa

Display control 8279  provides  a  16  byte  display  memory  and  refresh  logic.  Every address in the display memory corresponds to a display unit with address zero represen

The modes are determined by the contents of the control register, whose format is given in Figure These modes are: Mode 0: If a group is in mode 0, it is divided into 2 sets.

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