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

Marketing, what ford needs to do to make sure it is sensitive to changes in...

what ford needs to do to make sure it is sensitive to changes in the cultural environment in the country

Implementation of the waste-to-energy recycling plant, Question 1: Disc...

Question 1: Discuss the advantages and disadvantages of using: (a) An internal PR department. (b) Hiring an external PR consultancy service. Question 2: You are the

How is advertising affected by retaining customers, How is Advertising affe...

How is Advertising affected by retaining customers of a firm? Advertising: Customers genrally influence other members of their affect group who rely upon them for referen

What is the importance of customer care, Question: When the customer pa...

Question: When the customer pays for a product or service, it is assumed that the product will work correctly or that the service received is as promised. Ideally, the customer

What is advertising agency, Q. What is Advertising Agency? Advertising ...

Q. What is Advertising Agency? Advertising Industry engages three major components. Advertiser, Media and advertising agency. The person who makes a decision to advertise the p

Explain about the consumer movement in marketing activities, Explain about ...

Explain about the consumer movement in marketing activities. Consumer movement: Avarious collection of independent peoples, groups and organizations seeking to defend the

What are the various stages of new product development, What are the variou...

What are the various stages of new product development? Each of New Product Development’s stages involves considerable study and analysis at each stage. A management decision i

Selling, bwhaviour is like smoke sellers waste useful periods in studying b...

bwhaviour is like smoke sellers waste useful periods in studying buyers behaviour conduct a reasearh on why and highlight five reasons.

TEST MARKETING, Explain the various approaches that are followed by FMCG CO...

Explain the various approaches that are followed by FMCG COMPANIES IN TEST MARKETING

Jumpin jack flash (Case from Management Study ), Do you think Jack is equi...

Do you think Jack is equipped with the managerial skills needed to head up a team that develops strategies for adapting existing company products into new products for sales

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