Logo 
Search:

Assembly Language Articles

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

PROGRAM TO WRITE A PROGRAM TO COMPARE TO MEMORY LOCATION

Posted By: Jayden Evans     Category: Assembly Language     Views: 5162

A PROGRAM TO WRITE A PROGRAM TO COMPARE TO MEMORY LOCATION.

Code for PROGRAM TO WRITE A PROGRAM TO COMPARE TO MEMORY LOCATION in Assembly Language

DATA SEGMENT
        A DB 10H
        B DB 20H
        MSG1 DB 10,13,"BOTH A AND B ARE EQUAL$"
        MSG2 DB 10,13,"A IS GREATER THAN B$"
        MSG3 DB 10,13,"B IS GREATER THAN A$"

DATA ENDS

CODE SEGMENT
        ASSUME CS:CODE,DS:DATA
        START:
                MOV AX,DATA
                MOV DS,AX

                MOV AL,A
                CMP AL,B
                JZ LAB1
                JA LAB2
                MOV AH,09H
                LEA DX,MSG3
                INT 21H
                JMP END1
        LAB1:
                MOV AH,09H
                LEA DX,MSG1
                INT 21H
                JMP END1
        LAB2:
                MOV AH,09H
                LEA DX,MSG2
                INT 21H
                JMP END1
                
         END1:   MOV AX,4C00H
                INT 21H

CODE ENDS
        END START


OUTPUT
***********

D:\tasm\tasm1>K

B IS GREATER THAN A 
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO WRITE A PROGRAM TO COMPARE TO MEMORY LOCATION Or get search suggestion and latest updates.

Jayden Evans
Jayden Evans author of PROGRAM TO WRITE A PROGRAM TO COMPARE TO MEMORY LOCATION is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
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!