Explain about data segment, Computer Engineering

DATA SEGMENT

 NUM1            DB      15h;     First number 

 NUM2            DB      20h;     Second number 

RESULT DB?  ; Put sum here

 CARRY DB? ; Put any carry here

DATA ENDS

CODE SEGMENT

                        ASSUME CS:CODE, DS:DATA

START:MOV AX, DATA; Initialise data segment

 MOV DS, AX; register using AX

MOV AL, NUM1; Bring the first number in AL

                        ADD AL, NUM2; Add the 2nd

                        Number to AL

                        MOV RESULT, AL; Store the result

                        RCL AL, 01; rotate carry into Least Significant Bit (LSB)

                        AND AL, 00000001B; Mask out all but LSB

                        MOV CARRY, AL; Store the carry 

                        MOV AX, 4C00h; Terminate to DOS 

 INT 21h

CODE ENDS

END START

Posted Date: 7/31/2013 6:08:51 AM | Location : United States







Related Discussions:- Explain about data segment, Assignment Help, Ask Question on Explain about data segment, Get Answer, Expert's Help, Explain about data segment Discussions

Write discussion on Explain about data segment
Your posts are moderated
Related Questions

In a raw Itanium, a "Processor Abstraction Layer" (PAL) is integrated into the system. When it is booted the PAL is loaded into the CPU and gives a low-level interface that abstrac

Q. How are the instructions executed and interpreted? All computers have a Unit which performs arithmetic and logical functions. This Unit is called as Arithmetic and Logic Uni

train booking algorithm for seat reservation

A v o iding Over fitting - Artificial intelligence As  we  discussed  in  the last  lecture,  over fitting  is  a  normal  problem  in machine learning. Decision trees suffe

What is Debate Debate took place in the 1980s and first half of the 1990s. It was resolved as RISC the winner since it allows more efficient pipelining, results in simpler hard

Convert (177.25) 10 to octal Ans. 177.25) 10 = (         ) 8 Firstly we take integer part Hence (177) 10 = (261) 8 Now as 0.25 x 8 = 2.00 and 0.00 x 8 = 0 Therefor

distributed & centralized system in computer network

How Race Around Condition can be avoided? Ans: The race around condition can be avoided if 1. Duration of clock pulse being high is small like comparative to the dela

First-Order Models: Here if we proposed first-order logic as a good knowledge representation language than propositional logic is just because there is more expressive than we