Add two five-byte numbers using arrays, Marketing Management

Assignment Help:

Program: Add two five-byte numbers using arrays

; ALGORITHM:

;           Make count = LEN

;           Clear the carry flag

;           Load address of NUM1

;           REPEAT

;                       Put byte from NUM1 in accumulator

;                       Add byte from NUM2 to accumulator + carry

;                       Store result in SUM

;                       Decrement count

;                       Increment to next address

;           UNTIL count = 0

;           Rotate carry into LSB of accumulator

;           Mask all but LSB of accumulator

;           Store carry result, address pointer in correct position.

; PORTS   : None used

; PROCEDURES: None used

; REGISTERS: Uses CS, DS, AX, CX, BX, DX

DATA SEGMENT

                        NUM1 DB 0FFh, 10h ,01h ,11h ,20h

                        NUM2 DB 10h, 20h, 30h, 40h ,0FFh

                        SUM DB 6DUP (0)

DATA ENDS

                        LEN EQU 05h; constant for length of the array

CODE SEGMENT

                        ASSUME CS: CODE, DS: DATA

START:           MOV AX, DATA; initialise data segment

                        MOV DS, AX; using AX register

                        MOV SI, 00; load displacement of 1stnumber.

                                                ; SI is being used as index register

                        MOV CX, 0000; clear counter

                        MOV CL, LEN; set up count to designed length

                        CLC   ; clear carry. Ready for addition

AGAIN:          MOV AL, NUM1 [SI]; get a byte from NUM1

ADC AL, NUM2 [SI]; add to byte from NUM2 with carry

MOV SUM [SI], AL; store in SUM array

INC SI

LOOP AGAIN; continue until no more bytes

RCL AL, 01h; move carry into bit 0 of AL

AND AL, 01h; mask all but the 0th bit of AL

MOV SUM [SI], AL; put carry into 6th byte

FINISH:          MOV AX, 4C00h

INT 21h

CODE             ENDS

END START


Related Discussions:- Add two five-byte numbers using arrays

What is understand by extended marketing mix, Question 1: a) What is m...

Question 1: a) What is meant by Customer Relationship Management (CRM)? b) Nestlé's products include baby food, bottled water, breakfast cereals, coffee, confectionery, da

Conditional probability, What is Conditional Probability? Two events A ...

What is Conditional Probability? Two events A and B are said to be dependent when  B  can occur only when A is known to have occurred (or vice versa). The probability attached

Show the characteristics of distribution channels, Q. Show the Characterist...

Q. Show the Characteristics of Distribution Channels? Characteristics of Distribution Channels: Distribution channels are able to be classified on the basis of geographical d

Define the concept of relationship marketing, Question 1: (a) Using an...

Question 1: (a) Using an example from the local context, explain how an organisation can counter negative publicity. (b) Discuss the impact that customer retention has on

Process of the environmental analysis, Procedure of the environmental analy...

Procedure of the environmental analysis: Step 1: assess the nature of the environment: it is useful to take a view of the nature of the organization's environment in terms of

Current balance sheet, Well Water has been in business nearly 100 years, ha...

Well Water has been in business nearly 100 years, has always been owned by the Gerry family, and is the second largest bottled water firm in the area in terms of annual sales. To h

Uncontrollable variables, # what are the uncontollable variables you think ...

# what are the uncontollable variables you think may affect the segment of your camera

Repeat purchase rate, This is the number of times a consumer purchases the ...

This is the number of times a consumer purchases the similar product within a specific time interval.

Difficulties in evaluation advertising effectiveness, Difficulties in Evalu...

Difficulties in Evaluation advertising effectiveness There are several difficulties and hindrances in the evaluation of advertisement -effectiveness. The major difficulties are

Define benefit pension plan, 1. Issued 200,000 shares of $1 par value commo...

1. Issued 200,000 shares of $1 par value common stock for $10 per share. 2. Issued a $1,000,000 face value zero-coupon bond with a five-year maturity for $747,260 that is conver

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd