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

Distinguish between visible and non-visible cultures, Each country or regio...

Each country or region has a specific culture which is due to similarities in religion, language, beliefs and values. This could result in a "cultural challenge for international m

Explain the microsoft dynamics crm case resolution process, Question 1: ...

Question 1: (a) Microsoft Dynamics CRM system can be used to meet the needs of Customer Support and Product Support department. Explain the main modules in the Service sectio

Draw a supply curve, Suppose the US and Mexico both produce semiconductors ...

Suppose the US and Mexico both produce semiconductors and auto parts and the US has a comparative advantage in semiconductors while Mexico has a comparative advantage in auto parts

Marketing system, Taking an example of a new company, create a simple and c...

Taking an example of a new company, create a simple and complex marketing system that helps to enhance the sales of your organisation.

Importance of the study of the consumer behaviour, Importance of the study ...

Importance of the study of the consumer behaviour: in olden days, the importance of consumers behaviour was not realized because it was sellers in the olden days, the importance o

Jumpin jack flash, what management skills did jack demonstrate as a marketi...

what management skills did jack demonstrate as a marketing manager at the travel products company? What management skills did he demonstrate as a VP at the consumers product firm?

What is the meaning of societal marketing concept, What is the meaning of s...

What is the meaning of societal marketing concept? Meaning: Societal marketing concept is the idea which the organization must find out the needs, interests and wants of

Marketing communication for a new product (Diet cupcakes), 1. Use any tool ...

1. Use any tool of the promotion mix tools to promote and sell your new product “Diet cupcakes”. Specify the tools and the reason for selecting it. 2. Screen the communication o

homework problem, A trapezoid midsegment measures 6. One of the bases meas...

A trapezoid midsegment measures 6. One of the bases measures 10. What is the measure of the other base? What rule makes this problem solvable

Marketing and Brand Management, For this Final Project, imagine that an org...

For this Final Project, imagine that an organisation that owns and manages a brand is experiencing a critical downturn in its business. The organisation needs to expand its brand o

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