Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to find whether the input number is divisible by n or not

Posted By: Grace Campbell     Category: Assembly Language     Views: 4902

Write a program to find whether the input number is divisible by n or not.

Code for Program to find whether the input number is divisible by n or not in Assembly Language

DATA SEGMENT
A DB 10
B DB 02
DATA ENDS
CODE SEGMENT
         ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      MOV AX,00
      MOV AL,A
      MOV BL,B
      DIV BL
      CMP AH,00
      JZ L1
      MOV CL,A
      MOV CH,00
      JMP L2
   L1:MOV CH,A
      MOV CL,00
   L2:MOV AH,4CH
      INT 21H
CODE ENDS
END START

;OUTPUT:->
;-G CS:0025
;
;AX=0005  BX=0002  CX=0A00  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0025   NV UP EI PL ZR NA PE NC
;0BA9:0025 B44C          MOV     AH,4C
  
Share: 



Grace Campbell
Grace Campbell author of Program to find whether the input number is divisible by n or not is from Toronto, Canada.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!