Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

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

Posted By: Herberta Miller     Category: Unix / Linux / Ubuntu     Views: 6701

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

Code for Program to perform all ADDITION on two operands : (decimal, binary, octal,hexadecimal) in Unix / Linux / Ubuntu

DATA SEGMENT
A DB 10
B DB 20
C DB ?

A1 DB 10H
B1 DB 20H

A2 DB 10O
B2 DB 20O

A3 DB 10B
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
      ADD AL,B
      MOV C,AL

      MOV AL,A1
      ADD AL,B1
      MOV C,AL

      MOV AL,A2
      ADD AL,B2
      MOV C,AL

      MOV AL,A3
      ADD AL,B3
      MOV C,AL
     
      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=0B98  ES=0B98  SS=0BA8  CS=0BA9  IP=0000   NV UP EI PL NZ NA PO NC
;0BA9:0000 B8A80B        MOV     AX,0BA8
;-t
;
;AX=0BA8  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0B98  ES=0B98  SS=0BA8  CS=0BA9  IP=0003   NV UP EI PL NZ NA PO NC
;0BA9:0003 8ED8          MOV     DS,AX
;-t
;
;AX=0BA8  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0005   NV UP EI PL NZ NA PO NC
;0BA9:0005 B400          MOV     AH,00
;-t
;
;AX=00A8  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0007   NV UP EI PL NZ NA PO NC
;0BA9:0007 A00000        MOV     AL,[0000]                          DS:0000=0A
;-t
;
;AX=000A  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=000A   NV UP EI PL NZ NA PO NC
;0BA9:000A 02060100      ADD     AL,[0001]                          DS:0001=14
;-t
;
;AX=001E  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=000E   NV UP EI PL NZ NA PE NC
;0BA9:000E A20200        MOV     [0002],AL                          DS:0002=00
;-t
;
;AX=001E  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0011   NV UP EI PL NZ NA PE NC
;0BA9:0011 A00300        MOV     AL,[0003]                          DS:0003=10
;-t
;
;AX=0010  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0014   NV UP EI PL NZ NA PE NC
;0BA9:0014 02060400      ADD     AL,[0004]                          DS:0004=20
;-t
;
;AX=0030  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0018   NV UP EI PL NZ NA PE NC
;0BA9:0018 A20200        MOV     [0002],AL                          DS:0002=1E
;
;-t
;
;AX=0030  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=001B   NV UP EI PL NZ NA PE NC
;0BA9:001B A00500        MOV     AL,[0005]                          DS:0005=08
;-t
;
;AX=0008  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=001E   NV UP EI PL NZ NA PE NC
;0BA9:001E 02060600      ADD     AL,[0006]                          DS:0006=10
;-t
;
;AX=0018  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0022   NV UP EI PL NZ NA PE NC
;0BA9:0022 A20200        MOV     [0002],AL                          DS:0002=30
;-t
;
;AX=0018  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0025   NV UP EI PL NZ NA PE NC
;0BA9:0025 A00700        MOV     AL,[0007]                          DS:0007=02
;-t
;
;AX=0002  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0028   NV UP EI PL NZ NA PE NC
;0BA9:0028 02060800      ADD     AL,[0008]                          DS:0008=02
;-t
;
;AX=0004  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=002C   NV UP EI PL NZ NA PO NC
;0BA9:002C A20200        MOV     [0002],AL                          DS:0002=18
;-t
;
;AX=0004  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=002F   NV UP EI PL NZ NA PO NC
;0BA9:002F B44C          MOV     AH,4C
;-t
;
;AX=4C04  BX=0000  CX=0043  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=0031   NV UP EI PL NZ NA PO NC
;0BA9:0031 CD21          INT     21
  
Share: 



Herberta Miller
Herberta Miller author of Program to perform all ADDITION on two operands : (decimal, binary, octal,hexadecimal) is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

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

 
Osita Unamba from United States Comment on: Mar 11

1FF8
+ F8


View All Comments