Showing posts with label count. Show all posts
Showing posts with label count. Show all posts

Tuesday, December 1, 2020

Assembly 8086 program to Count number of 0's in a number

Hey guys!! 


Today we will see the program of microprocessor 8086 to find and count the number of ones in a register or 16 bit number.


Let's go!!


data segment

number01 dw 4560h

counter db 00h

data ends

code segment

start :

assume cs:code, ds:data

mov dx,data

mov ds,dx

mov cx,10h

mov ax,number01

up:ror ax,1

jc dn

inc counter

dn: loop up

mov ah,04ch

int21h

code ends

end start

 

Programs:-

For many other Language Programs of microprocessor 8086, C++ , Data Structures and MSBTE diploma and engineering related concepts visit our  BLOG

 

Monday, November 2, 2020

8086 assembly program to Count Number of 1's in a 8-bit number register

Hey friends! 

Today we will take a look at the program of microprocessor 8086 assembly program of 8-bit to Count the number of 1's in the register.

Lets Begin!!.....


data segment

num1 db 2100h

counting db oh

data ends

code segment

start :

assume cs:code, ds:data

mov ax,data

mov ds,ax

mov ax,num1

mov bl ,00h

mov cx,0010h

aa: rcl ax

jnc nn

inc bl

nn:loop aa

mov counting,bl

mov ah,4ch

int21h

code ends

end start

Programs:-

For many other Language Programs of microprocessor 8086, C++ , Data Structures and MSBTE diploma and engineering related concepts visit our  BLOG

Thursday, June 20, 2019

Assembly Language Program to COUNT NUMBER OF 1’s IN ARRAY

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

DATA SEGMENT        
ARRAY DB 9H,8H,50H,3H,20H,6H        
ONES  DB ?        
DATA ENDS
CODE SEGMENT
START: ASSUME CS:CODE, DS:DATA 
MOV AX, DATA 
MOV DS, AX        
MOV AL, NUM     
MOV CL , 06H 
MOV SI , OFFSET ARRAY
UP : MOV AL , [SI]
ROR AL, 1            
JNC EXIT
INC ONES     
JMP EXIT
EXIT:INC SI
 DEC CL
JNZ UP
 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

Wednesday, June 12, 2019

Assembly Language Program to COUNT NUMBER OF 0’s


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

DATA SEGMENT        
ARRAY DB 9H,8H,50H,3H,20H,6H        
Z  DB ?        
DATA ENDS
CODE SEGMENT
START: ASSUME CS:CODE, DS:DATA 
MOV AX, DATA 
MOV DS, AX        
MOV AL, NUM     
MOV CL , 06H  
UP : MOV AL , [SI]
ROR AL, 1            
JC EXIT
INC Z     
JMP EXIT
EXIT: INC SI
DEC CL
JNZ UP
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