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

Discuss about the holistic marketing approach of marketing, Discuss about t...

Discuss about the Holistic Marketing approach of marketing. The Holistic concept is depends on the design, implementation and development of marketing activities, processes and

Marketing, Read the journal article Lafferty, B. A., & Hult, G. T. M. (2001...

Read the journal article Lafferty, B. A., & Hult, G. T. M. (2001) ‘A synthesis of contemporary market orientation perspectives’, European Journal of Marketing, 35 (1/2), pp. 92–109

Briefly describe the two main forms of fdi, Economies in Asia and Latin Ame...

Economies in Asia and Latin America have been a target for two main forms of Foreign Direct Investment (FDI) by Multi National Enterprises (MNEs). Briefly describe the two main for

Explain in detail the various steps in menu costing, Question 1: You ha...

Question 1: You have just been appointed as Food & Beverage Controller of a medium -size hotel and you have been requested to set up a new control system. (i) Explain in d

Explain the stages of product life cycle, Q. Explain the Stages of Product ...

Q. Explain the Stages of Product life cycle? Stages of Product life cycle. a) Introduction stage - Advertising for consumers and Personal selling for middlemen. b) Growth

How you will you measure the effectiveness of the ads, Q. How you will you ...

Q. How you will you measure the effectiveness of the ads? Advertising is a non personal structure of mass communication whose objective is to attract attention to provide infor

Promotion mix, Developing a promotion mix is contingent on many factors, in...

Developing a promotion mix is contingent on many factors, including the type of product and the product''s attributes. Which of the four promotional methods-advertising, personal s

Concept development and testing - new product development, Concept Developm...

Concept Development and Testing The third stage in the procedure is concept development and testing. Concepts can take on several forms are following: 1). A product idea is

Explain factors in a company''s macroenvironment, Question 1: Just as i...

Question 1: Just as it is a mistake for marketers to consider Mauritius as a homogenous group of customers with the same values, culture and lifestyle, it is also a mistake for

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