Use of array in assembly language, Marketing Management

Assignment Help:

Q. Use of array in assembly language?

Let's write a program to add two 5-byte numbers stored in an array. For illustration two numbers in hex can be:

1018_Use of array in assembly language.png

Let's also presume that numbers are represented as the lowest significant byte first and put in memory in two arrays. The result is stored in third array SUM. SUM also includes the carry out information therefore would be 1 byte longer than number arrays.

; 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:- Use of array in assembly language

Briefly characterize factors influencing consumer behaviour, Question 1: ...

Question 1: (a). Define the term "marketing" and explain the five key tasks of marketing (b). Indicate the differences and similarities between the following terms: marke

Explain diffrent types of illustration of print-ad-copy, Q. Explain diffren...

Q. Explain diffrent types of Illustration of print-ad-copy? Types of Illustration:- Photo of Product. Photo of Product in use. Photos from different angle.

Explain about the sales promotion, Explain about the Sales Promotion S...

Explain about the Sales Promotion Sales promotion comprises numerous marketing techniques which are often used tactically to provide added value to an offering, with aim of ac

Scope of the marketing planning, Scope of the marketing planning: The p...

Scope of the marketing planning: The planning for the marketing is an extension of sales forecasting beyond the point where the future course of events has already been predete

Third barrier of exchange in channels distribution, Explain the working of ...

Explain the working of third barrier of exchange in channels distribution. The third barrier arises through the variation in quantities and assortment demanded. Manufacturers u

What are the advantages of exporting in marketing, What are the advantages ...

What are the advantages of exporting in marketing? The advantages of exporting are illustrated in below: • Manufacturing is home based therefore, this is less risky than ove

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

Discuss the principles of market skimming, Question 1: a) What are the...

Question 1: a) What are the evaluative criteria marketing management can use to assess the usefulness of marketing segmentation variables? b) Explain how ‘organisational

Influence of environment in marketing, Influence of environment: 1.   ...

Influence of environment: 1.       Opportunity: an event in the environment that may be favourable to a company may be suitably exploited by it for the overall benefit of the

Determine the uses of marketing communications in business, Determine the u...

Determine the uses of marketing communications in business Organisations are all well-known brand-names however there are hundreds of thousands of smaller organisations which

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