Logo 
Search:

Assembly Language Articles

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

Program to perform all DIVISION on two operands : (decimal, binary, octal,hexadecimal)

Posted By: Konrada Schmidt     Category: Assembly Language     Views: 5077

Write a program to perform all DIVISION on two operands. (decimal, binary, octal,hexadecimal).

Code for Program to perform all DIVISION on two operands : (decimal, binary, octal,hexadecimal) in Assembly Language

DATA SEGMENT
A DB 20
B DB 10
C DW ?

A1 DB 20H
B1 DB 10H

A2 DB 20O
B2 DB 10O

A3 DB 11B
B3 DB 10B
DATA ENDS
CODE SEGMENT
      ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      MOV AH,00
      MOV AL,A
      DIV B
      MOV C,AX

      MOV AL,A1
      DIV B1
      MOV C,AX

      MOV AL,A2
      DIV B2
      MOV C,AX

      MOV AL,A3
      DIV B3
      MOV C,AX

      MOV AH,4CH
      INT 21H
CODE ENDS
END START

;OUTPUT:->
;-R
;AX=0000  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0B9C  ES=0B9C  SS=0BAC  CS=0BAD  IP=0000   NV UP EI PL NZ NA PO NC
;0BAD:0000 B8AC0B        MOV     AX,0BAC
;-T
;
;AX=0BAC  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0B9C  ES=0B9C  SS=0BAC  CS=0BAD  IP=0003   NV UP EI PL NZ NA PO NC
;0BAD:0003 8ED8          MOV     DS,AX
;-T
;
;AX=0BAC  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0005   NV UP EI PL NZ NA PO NC
;0BAD:0005 B400          MOV     AH,00
;-T
;
;AX=00AC  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0007   NV UP EI PL NZ NA PO NC
;0BAD:0007 A00000        MOV     AL,[0000]                          DS:0000=14
;-T
;
;AX=0014  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=000A   NV UP EI PL NZ NA PO NC
;0BAD:000A F6360100      DIV     BYTE PTR [0001]                    DS:0001=0A
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=000E   NV UP EI PL NZ NA PO NC
;0BAD:000E A30200        MOV     [0002],AX                          DS:0002=0000
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0011   NV UP EI PL NZ NA PO NC
;0BAD:0011 A00400        MOV     AL,[0004]                          DS:0004=20
;-T
;
;AX=0020  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0014   NV UP EI PL NZ NA PO NC
;0BAD:0014 F6360500      DIV     BYTE PTR [0005]                    DS:0005=10
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0018   NV UP EI PL NZ NA PO NC
;0BAD:0018 A30200        MOV     [0002],AX                          DS:0002=0002
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=001B   NV UP EI PL NZ NA PO NC
;0BAD:001B A00600        MOV     AL,[0006]                          DS:0006=10
;-T
;
;AX=0010  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=001E   NV UP EI PL NZ NA PO NC
;0BAD:001E F6360700      DIV     BYTE PTR [0007]                    DS:0007=08
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0022   NV UP EI PL NZ NA PO NC
;0BAD:0022 A30200        MOV     [0002],AX                          DS:0002=0002
;-T
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0025   NV UP EI PL NZ NA PO NC
;0BAD:0025 A00800        MOV     AL,[0008]                          DS:0008=03
;-T
;
;AX=0003  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0028   NV UP EI PL NZ NA PO NC
;0BAD:0028 F6360900      DIV     BYTE PTR [0009]                    DS:0009=02
;-T
;
;AX=0101  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=002C   NV UP EI PL NZ NA PO NC
;0BAD:002C A30200        MOV     [0002],AX                          DS:0002=0002
;-T
;
;AX=0101  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=002F   NV UP EI PL NZ NA PO NC
;0BAD:002F B44C          MOV     AH,4C
;-T
;
;AX=4C01  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BAC  ES=0B9C  SS=0BAC  CS=0BAD  IP=0031   NV UP EI PL NZ NA PO NC
;0BAD:0031 CD21          INT     21
  
Share: 



Konrada Schmidt
Konrada Schmidt author of Program to perform all DIVISION on two operands : (decimal, binary, octal,hexadecimal) is from Frankfurt, Germany.
 
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!