Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

based on the example below write a code in the same manner please to answer the problem and be detailed in comments thank you This

based on the example below write a code in the same manner please to answer the problem and be detailed in comments
thank you
image text in transcribed
image text in transcribed
This program adds 34-digit numbers encoded as BCD and stored in ROM, ; then stores the results in RAM ; at address 30H Assume that there is no overflow ORG 0050H NUMBERS: ; 2374 3230 2579 (Little Endian) DB 748,234, 308,32H, 797,258 DEST EQU 30H ORG 0000H MOV DPTR, "NUMBERS MOV Ri, DEST CLR A ; clear a MOV RO, A ; initialize ndx MOVC A, A+DPTR ; Ist low byte MOV R2, A INC RO MOV A, RO MOVC A, A+DPTR : 1st high byte MOV R3, A INC RO MOV A, RO MOVC A, A+DPIR ; 2nd low byte ADD A, R2 R2 - Ll + L2 DA A MOV R2, A : low byte result INC RO ; INC does not affect carry flag MOV A, RO MOVC A, A+DPTR ; 2nd high byte ADDC A, R3, R3 - H + H2 DA A MOV R3, A ; high byte result INC RO MOV A, RO MOVC A, CA+DPTR ; 3rd low byte ADD A, R2 R2 - R2 + 13 DA A MOV @R1, A ; store low byte of the result INC RO MOV A, RO MOVC A, A+DPTR ; 3rd high byte ADDC A, R3 R3 - 83 + H3 DA A INC RI MOV BRI, A : store high byte of the result HERE: SJMP HERE END 2. (7 points) Assume two 24-bit numbers (i.e., 3 bytes) are defined in ROM using appropriate assembler directive and are labeled as "Numl" and "Num2". Each number stored in ROM using Big Endian convention where the lower address contains the most significant part of the number. For example, if the number stored in memory at location 0 and its value is 3245FD 6. then address 0 contains 32H, next address contains 45H, and lastly address 2 contains FDH. Write a program that will add these two numbers and store the result starting at RAM location 10H using Big Endian convention

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions