Showing posts with label even/odd. Show all posts
Showing posts with label even/odd. Show all posts

Saturday, June 20, 2020

8086 Assembly Program find number of odd and even numbers in an Array

For many other Assembly Language  Programs related to microprocessor 8086 , C++ , C, DataStructures visit our  BLOG 

data segment
blk1 db  10h,40h,30h,60h
e db ?h
o db ?h
data ends
code segment
strat: asseume code:cs, ds:data
mov ax,data
mov ds,ax
lea si,blk1
mov bl , 0h
mov bh, 0h
mov cl , 04h
up: mov al,[si]
ror al , 1
jc go
inc bl
jmp next
go: inc bh
next: inc si
  dec cl
   jnz up
   mov e,bl
   mov o,bh
int 3
code ends
end start

block transfer using string
string compare
sum of SERIES BCD numbers
Block reverse

Programs:-

For many other Assembly Language  Programs related to microprocessor 8086 , C++ , C, DataStructures visit our  BLOG 

There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations,BCD ,etc

Wednesday, May 29, 2019

8086 Assembly program to check if the number is Even or Odd


For many other Assembly Language  Programs related to microprocessor 8086, c++ , datastructures  visit our  BLOG 
Assembly program to check whether number is even or odd in 8086
8086 program to compute even or odd number

DATA SEGMENT        
NUM DB 9H        
ODD DB ?        
EVE DB ?
DATA ENDS
CODE SEGMENT
START: ASSUME CS:CODE,DS:DATA 
MOV AX,DATA 
MOV DS,AX        
MOV AL,NUM        
ROR AL,1            
JNC DN
INC ODD         
JMP EXIT
DN: INC  EVE
JMP EXIT
 EXIT:  MOV AH,4CH 
INT 21H
CODE ENDS
END START




Programs:-

For many other Assembly Language  Programs related to microprocessor 8086, c++ , datastructures  visit our  BLOG 

There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations ,etc

Assembly Language Program to count number of ODD and EVEN nos


DATA SEGMENT        
ARRAY  DB 9H ,40H,88H,3H,20H,66H       
ODD  DB ?        
EVEN DB ?
DATA ENDS
CODE SEGMENT
START: ASSUME CS:CODE, DS:DATA 
MOV AX, DATA 
MOV DS, AX       
MOV CL , 06H
MOV SI , OFFSET ARRAY
NEXT : MOV AL , [SI]
ROR AL, 1
JC NEXT1
INC EVEN
JMP EXIT
NEXT1: INC ODD  
JMP EXIT
EXIT: INC SI
DEC CL
JNZ NEXT
MOV AH , 4CH
INT 21H
CODE ENDS
END START